Skip to content
Snippets Groups Projects

Fixing JSON float values encoding/decoding (issue #609)

Merged Adam Knapp requested to merge json-fix into master
2 files
+ 3
3
Compare changes
  • Side-by-side
  • Inline
Files
2
+ 2
2
@@ -130,7 +130,7 @@ bool JSON_Tokenizer::check_for_number(bool* is_float /* = NULL */)
zero = false;
break;
case '0':
if (!first_digit && (exponent_mark || (!decimal_point && zero))) {
if (!first_digit && ((exponent_mark && zero) || (!decimal_point && zero))) {
return false;
}
zero = true;
@@ -144,7 +144,7 @@ bool JSON_Tokenizer::check_for_number(bool* is_float /* = NULL */)
case '7':
case '8':
case '9':
if (!first_digit && zero && (!decimal_point || exponent_mark)) {
if (!first_digit && zero && (!decimal_point || (exponent_mark && !zero))) {
return false;
}
first_digit = true;
Loading