mirror of
https://github.com/sheumann/DiskBrowser.git
synced 2024-12-21 04:29:48 +00:00
Ignore garbage data after the json object.
This should work around an issue (possible Marinetti bug?) where a portion of the beginning of the response could be erroneously repeated at the end of it.
This commit is contained in:
parent
9f245a3f79
commit
990ea5fe97
6
json.c
6
json.c
@ -35,6 +35,8 @@
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#define JSON_ALLOW_TRAILING_GARBAGE 1
|
||||
|
||||
const struct _json_value json_value_none;
|
||||
|
||||
#include <stdio.h>
|
||||
@ -501,6 +503,7 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
if (!b)
|
||||
break;
|
||||
|
||||
#ifndef JSON_ALLOW_TRAILING_GARBAGE
|
||||
switch (b)
|
||||
{
|
||||
whitespace:
|
||||
@ -513,6 +516,9 @@ json_value * json_parse_ex (json_settings * settings,
|
||||
|
||||
goto e_failed;
|
||||
};
|
||||
#else
|
||||
continue;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (flags & flag_seek_value)
|
||||
|
Loading…
Reference in New Issue
Block a user