We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 5284536 commit 16baa32Copy full SHA for 16baa32
1 file changed
JSONTokener.java
@@ -144,6 +144,8 @@ public static int dehexchar(char c) {
144
}
145
146
/**
147
+ * Checks if the end of the input has been reached.
148
+ *
149
* @return true if at the end of the file and we didn't step back
150
*/
151
public boolean end() {
@@ -168,7 +170,8 @@ public boolean more() throws JSONException {
168
170
throw new JSONException("Unable to preserve stream position", e);
169
171
172
try {
- if(this.reader.read()<0) {
173
+ // -1 is EOF, but next() can not consume the null character '\0'
174
+ if(this.reader.read() <= 0) {
175
this.eof = true;
176
return false;
177
0 commit comments