src/xspice/evt/evtprint.c, bug fix, avoid segfault

print an error message if no circuit has been loaded
This commit is contained in:
h_vogt 2016-01-27 22:57:22 +01:00 committed by rlar
parent 9531318d8f
commit a162ecec9f
1 changed files with 8 additions and 0 deletions

View File

@ -143,6 +143,10 @@ void EVTprint(
/* Get needed pointers */
ckt = g_mif_info.ckt;
if (!ckt) {
fprintf(cp_err, "Error: no circuit loaded.\n");
return;
}
node_table = ckt->evt->info.node_table;
/* Get data for each argument */
@ -319,6 +323,10 @@ static int get_index(
index = 0;
ckt = g_mif_info.ckt;
if (!ckt) {
fprintf(cp_err, "Error: no circuit loaded.\n");
return(-1);
}
node = ckt->evt->info.node_list;
while(node) {