json: Use state machine and fix 1E10 parsing

Use a state machine to check for valid numbers and fix the 1E10
parsing case.

With help from Claude.
This commit is contained in:
Wim Taymans 2026-03-09 18:17:04 +01:00
parent c745582ef5
commit f6939a1cf0
2 changed files with 24 additions and 34 deletions

View file

@ -740,6 +740,7 @@ PWTEST(json_float_check)
{ "-1.", 1, 0 },
{ "-.0", 1, 0 },
{ "-1E10", 1, 1 },
};
unsigned i;