diff options
author | Petri Lehtinen <petri@digip.org> | 2009-10-29 15:42:05 +0200 |
---|---|---|
committer | Petri Lehtinen <petri@digip.org> | 2009-10-29 15:45:16 +0200 |
commit | d3959a8ce79bb30a8b39a275a4682885e97d17cc (patch) | |
tree | a8ea0cfd944b6212065b7ba6eba456bc4e8ca29f /src | |
parent | f243930b6843295b81a4e4025497e40f19ff53ac (diff) | |
download | jansson-d3959a8ce79bb30a8b39a275a4682885e97d17cc.zip jansson-d3959a8ce79bb30a8b39a275a4682885e97d17cc.tar.gz jansson-d3959a8ce79bb30a8b39a275a4682885e97d17cc.tar.bz2 |
load: Parse a badly put - sign correctly
Thanks to Manolis Delakis for reporting.
Diffstat (limited to 'src')
-rw-r--r-- | src/load.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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; |