From 3a8b431a5b07baa98ea9d5d6d1a3512425035049 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 22 Mar 2005 20:28:47 +0000 Subject: [PATCH] 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. --- simgear/nasal/string.c | 3 +++ 1 file changed, 3 insertions(+) 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); -- 2.39.5