Skip to content

Commit

Permalink
Handle empty JSON files gracefully
Browse files Browse the repository at this point in the history
This ensures endptr is always set to something sensible even if the input data was completely empty.
  • Loading branch information
ChrisJefferson committed May 27, 2014
1 parent add97a2 commit 3e3214b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gason.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ JsonParseStatus jsonParse(char *s, char **endptr, JsonValue *value, JsonAllocato

bool separator = true;

*endptr = s;

while (*s) {
JsonValue o;

Expand Down

0 comments on commit 3e3214b

Please sign in to comment.