load: Parse a badly put - sign correctly

Thanks to Manolis Delakis for reporting.
This commit is contained in:
Petri Lehtinen
2009-10-29 15:42:05 +02:00
parent f243930b68
commit d3959a8ce7
3 changed files with 37 additions and 3 deletions

View File

@@ -418,11 +418,15 @@ static int lex_scan_number(lex_t *lex, char c, json_error_t *error)
goto out;
}
}
else /* c != '0' */ {
else if(isdigit(c)) {
c = lex_get_save(lex, error);
while(isdigit(c))
c = lex_get_save(lex, error);
}
else {
lex_unget_unsave(lex, c);
goto out;
}
if(c != '.' && c != 'E' && c != 'e') {
long value;