From a2b5288a3de4b21a0dbb9708a0fdd8f9e1c007dc Mon Sep 17 00:00:00 2001 From: rlar Date: Sat, 28 Feb 2015 19:01:40 +0100 Subject: [PATCH] parser/inpeval.c, bug fix, allow at most one sign char when parsing a number --- src/spicelib/parser/inpeval.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/spicelib/parser/inpeval.c b/src/spicelib/parser/inpeval.c index 5012f4965..41a2ec259 100644 --- a/src/spicelib/parser/inpeval.c +++ b/src/spicelib/parser/inpeval.c @@ -46,7 +46,7 @@ double INPevaluate(char **line, int *error, int gobble) here = token; if (*here == '+') here++; /* plus, so do nothing except skip it */ - if (*here == '-') { /* minus, so skip it, and change sign */ + else if (*here == '-') { /* minus, so skip it, and change sign */ here++; sign = -1; } @@ -123,7 +123,7 @@ double INPevaluate(char **line, int *error, int gobble) /* now look for exponent sign */ if (*here == '+') here++; /* just skip + */ - if (*here == '-') { + else if (*here == '-') { here++; /* skip over minus sign */ expsgn = -1; /* and make a negative exponent */ /* now look for the digits of the exponent */