Add cm_cecit(). If the input file could not be opened, stop ngspice.

This commit is contained in:
Holger Vogt 2023-10-21 15:52:10 +02:00
parent 19ebfb1887
commit 10d7297798
3 changed files with 3 additions and 0 deletions

View File

@ -233,6 +233,7 @@ void cm_filesource(ARGS) /* structure holding parms, inputs, outputs, etc.
if (!loc->state->fp) { if (!loc->state->fp) {
cm_message_printf("cannot open file %s", PARAM(file)); cm_message_printf("cannot open file %s", PARAM(file));
loc->state->atend = 1; loc->state->atend = 1;
cm_cexit(1);
} }
} }
/* read, preprocess and store the data */ /* read, preprocess and store the data */

View File

@ -732,6 +732,7 @@ EXITPOINT:
free_local_data(loc); free_local_data(loc);
loc = (Table2_Data_t *) NULL; loc = (Table2_Data_t *) NULL;
} }
cm_cexit(1);
} }
return loc; return loc;
} /* end of function init_local_data */ } /* end of function init_local_data */

View File

@ -802,6 +802,7 @@ EXITPOINT:
free_local_data(loc); free_local_data(loc);
loc = (Table3_Data_t *) NULL; loc = (Table3_Data_t *) NULL;
} }
cm_cexit(1);
} }
return loc; return loc;
} /* end of function init_local_data */ } /* end of function init_local_data */