parser/inpeval.c, bug fix, allow at most one sign char when parsing a number

This commit is contained in:
rlar 2015-02-28 19:01:40 +01:00
parent 12e8ee750b
commit a2b5288a3d
1 changed files with 2 additions and 2 deletions

View File

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