mirror of
https://github.com/fankes/JSON-java-compat.git
synced 2025-09-08 03:24:27 +08:00
Don't skip past \0
when parsing JSON objects.
A better solution might be to use -1 instead 0 to represent EOF everywhere, which of course means changing `char` variables to `int`. The solution here is enough to solve the immediate problem, though. Fixes #758.
This commit is contained in:
@@ -253,7 +253,11 @@ public class JSONObject {
|
||||
switch (x.nextClean()) {
|
||||
case ';':
|
||||
case ',':
|
||||
if (x.nextClean() == '}') {
|
||||
c = x.nextClean();
|
||||
if (c == 0) {
|
||||
throw x.syntaxError("A JSONObject text must end with '}'");
|
||||
}
|
||||
if (c == '}') {
|
||||
return;
|
||||
}
|
||||
x.back();
|
||||
|
Reference in New Issue
Block a user