diff --git a/src/spicelib/parser/inperror.c b/src/spicelib/parser/inperror.c index 82c8cf0e2..86af46d26 100644 --- a/src/spicelib/parser/inperror.c +++ b/src/spicelib/parser/inperror.c @@ -3,7 +3,7 @@ Copyright 1990 Regents of the University of California. All rights reserved. Author: 1985 Thomas L. Quarles **********/ -/* +/* * provide the error message appropriate for the given error code */ @@ -30,29 +30,29 @@ char *INPerror(int type) const char *val; 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 ) { - val = errMsg; errMsg = NULL;} - else -/*CDHW end of hack CDHW*/ - val = SPerror(type); + val = errMsg; + errMsg = NULL; + } else + /*CDHW end of hack CDHW*/ + val = SPerror(type); if (!val) - return NULL; + return NULL; #ifdef HAVE_ASPRINTF if (errRtn) - asprintf(&ebuf, "%s detected in routine \"%s\"\n", val, errRtn); + asprintf(&ebuf, "%s detected in routine \"%s\"\n", val, errRtn); else - asprintf(&ebuf, "%s\n", val); + asprintf(&ebuf, "%s\n", val); #else /* ~ HAVE_ASPRINTF */ - if (errRtn){ - ebuf = TMALLOC(char, strlen(val) + strlen(errRtn) + 25); - sprintf(ebuf, "%s detected in routine \"%s\"\n", val, errRtn); - } - else{ - ebuf = TMALLOC(char, strlen(val) + 2); - sprintf(ebuf, "%s\n", val); + if (errRtn) { + ebuf = TMALLOC(char, strlen(val) + strlen(errRtn) + 25); + sprintf(ebuf, "%s detected in routine \"%s\"\n", val, errRtn); + } else { + ebuf = TMALLOC(char, strlen(val) + 2); + sprintf(ebuf, "%s\n", val); } #endif /* HAVE_ASPRINTF */ FREE(errMsg); /* pn: really needed ? */