mirror of
https://github.com/sheumann/DiskBrowser.git
synced 2024-11-22 13:33:52 +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
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#define JSON_ALLOW_TRAILING_GARBAGE 1
|
||||||
|
|
||||||
const struct _json_value json_value_none;
|
const struct _json_value json_value_none;
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -501,6 +503,7 @@ json_value * json_parse_ex (json_settings * settings,
|
|||||||
if (!b)
|
if (!b)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
#ifndef JSON_ALLOW_TRAILING_GARBAGE
|
||||||
switch (b)
|
switch (b)
|
||||||
{
|
{
|
||||||
whitespace:
|
whitespace:
|
||||||
@ -513,6 +516,9 @@ json_value * json_parse_ex (json_settings * settings,
|
|||||||
|
|
||||||
goto e_failed;
|
goto e_failed;
|
||||||
};
|
};
|
||||||
|
#else
|
||||||
|
continue;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
if (flags & flag_seek_value)
|
if (flags & flag_seek_value)
|
||||||
|
Loading…
Reference in New Issue
Block a user