Browse Source

main.c, inperror.c: unify errMsg

pre-master-46
h_vogt 13 years ago
parent
commit
ba6dd7b1af
  1. 2
      src/main.c
  2. 7
      src/spicelib/parser/inperror.c

2
src/main.c

@ -106,7 +106,7 @@ char *ft_rawfile = "rawspice.raw";
IFsimulator *ft_sim = NULL; IFsimulator *ft_sim = NULL;
char *errRtn; /* name of the routine declaring error */ 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' */ char *cp_program; /* program name 'ngspice' */

7
src/spicelib/parser/inperror.c

@ -27,16 +27,15 @@ extern int vasprintf(char **out, const char *fmt, va_list ap);
char *INPerror(int type) char *INPerror(int type)
{ {
const char *val;
char *val;
char *ebuf; char *ebuf;
/*CDHW Lots of things set errMsg but it is never used so let's hack it in CDHW*/ /*CDHW Lots of things set errMsg but it is never used so let's hack it in CDHW*/
if ( errMsg ) { if ( errMsg ) {
val = errMsg; val = errMsg;
errMsg = NULL;
} else } else
/*CDHW end of hack CDHW*/ /*CDHW end of hack CDHW*/
val = SPerror(type);
val = copy(SPerror(type));
if (!val) if (!val)
return NULL; return NULL;
@ -55,6 +54,6 @@ char *INPerror(int type)
sprintf(ebuf, "%s\n", val); sprintf(ebuf, "%s\n", val);
} }
#endif /* HAVE_ASPRINTF */ #endif /* HAVE_ASPRINTF */
FREE(errMsg); /* pn: really needed ? */
tfree(val);
return ebuf; return ebuf;
} }
Loading…
Cancel
Save