From: andy Date: Tue, 22 Mar 2005 20:28:47 +0000 (+0000) Subject: Don't parse a single "e" or "E" as a numerical zero. You need a X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=3a8b431a5b07baa98ea9d5d6d1a3512425035049;p=simgear.git Don't parse a single "e" or "E" as a numerical zero. You need a numerical prefix to use the 1.0e12 notation, "e" alone is not enough. --- diff --git a/simgear/nasal/string.c b/simgear/nasal/string.c index 9da446f4..69aa473a 100644 --- a/simgear/nasal/string.c +++ b/simgear/nasal/string.c @@ -199,6 +199,9 @@ static int tonum(unsigned char* s, int len, double* result) i += fraclen; } + // Nothing so far? Then the parse failed. + if(i == 0) return 0; + // Read the exponent, if any if(i < len && (s[i] == 'e' || s[i] == 'E')) i = readsigned(s, len, i+1, &exp);