sheredom / json.h

🗄️ single header json parser for C and C++
The Unlicense
698 stars 77 forks source link

Fix Unicode escapes and empty strings parsing #58

Closed kwikwag closed 6 years ago

kwikwag commented 6 years ago

The logic was reversed in the code that validates that the Unicode escape sequence ("\uXXXX") is long enough. Also, the wrong offset was pushed forward.

kwikwag commented 6 years ago

Hmm, after some testing I see that Unicode escape aren't parsed properly either. I'll add some more commits soon to fix this as well.

sheredom commented 6 years ago

Hey @kwikwag - thanks for the PR!

Is there any chance you could add a test or two for the problems you found? It'll help make sure I'd never accidentally regress something for you in future!

kwikwag commented 6 years ago

I also added a fix where empty strings were handled incorrectly. And corresponding tests. Should be good to go.

sheredom commented 6 years ago

Nice! Thanks for all the work :)