Prevent a crash if command 'save n1' has been given on a digital node n1.

Improved error message.
This commit is contained in:
Holger Vogt 2021-08-28 15:09:51 +02:00
parent 8e9a14678c
commit de1024a75b
2 changed files with 4 additions and 0 deletions

View File

@ -398,6 +398,7 @@ beginPlot(JOB *analysisPtr, CKTcircuit *circuitPtr, char *cktName, char *analNam
{
fprintf(cp_err, "Error: no data saved for %s; analysis not run\n",
spice_analysis_get_description(analysisPtr->JOBtype));
fprintf(cp_err, " Command 'save' on a digital node?\n");
return E_NOTFOUND;
}

View File

@ -625,6 +625,9 @@ EVTprintvcd(wordlist *wl)
more = MIF_FALSE;
next_step = 1e30;
for (i = 0; i < nargs; i++) {
/* prevent crash if save(d1), and d1 is a digital node */
if (node_data[i] == NULL)
continue;
step = node_data[i]->step;
g_evt_udn_info[udn_index[i]]->print_val
(node_data[i]->node_value, "all", &value);