mirror of
https://git.code.sf.net/p/ngspice/ngspice
synced 2026-08-22 13:57:32 +02:00
main.c, inperror.c: unify errMsg
This commit is contained in:
+1
-1
@@ -106,7 +106,7 @@ char *ft_rawfile = "rawspice.raw";
|
||||
IFsimulator *ft_sim = NULL;
|
||||
|
||||
char *errRtn; /* name of the routine declaring error */
|
||||
char *errMsg; /* descriptive message about what went wrong */
|
||||
char *errMsg = NULL; /* descriptive message about what went wrong */
|
||||
char *cp_program; /* program name 'ngspice' */
|
||||
|
||||
|
||||
|
||||
@@ -27,16 +27,15 @@ extern int vasprintf(char **out, const char *fmt, va_list ap);
|
||||
|
||||
char *INPerror(int type)
|
||||
{
|
||||
const char *val;
|
||||
char *val;
|
||||
char *ebuf;
|
||||
|
||||
/*CDHW Lots of things set errMsg but it is never used so let's hack it in CDHW*/
|
||||
if ( errMsg ) {
|
||||
val = errMsg;
|
||||
errMsg = NULL;
|
||||
} else
|
||||
/*CDHW end of hack CDHW*/
|
||||
val = SPerror(type);
|
||||
val = copy(SPerror(type));
|
||||
|
||||
if (!val)
|
||||
return NULL;
|
||||
@@ -55,6 +54,6 @@ char *INPerror(int type)
|
||||
sprintf(ebuf, "%s\n", val);
|
||||
}
|
||||
#endif /* HAVE_ASPRINTF */
|
||||
FREE(errMsg); /* pn: really needed ? */
|
||||
tfree(val);
|
||||
return ebuf;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user