main.c, inperror.c: unify errMsg

This commit is contained in:
h_vogt 2012-12-15 20:03:57 +01:00
parent 07ec7bd412
commit ba6dd7b1af
2 changed files with 4 additions and 5 deletions

View File

@ -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' */

View File

@ -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;
}