Address review

This commit is contained in:
Cornelius Riemenschneider
2023-10-24 16:03:35 +02:00
parent 9ba32a0440
commit 42c343e820

View File

@@ -79,7 +79,7 @@ public class JSONParser {
}
private char peek() {
return offset < length ? src.charAt(offset) : (char) -1;
return offset < length ? src.charAt(offset) : Character.MAX_VALUE;
}
private JSONValue readValue() throws ParseError {
@@ -356,7 +356,7 @@ public class JSONParser {
char c;
next();
next();
while ((c = peek()) != '\r' && c != '\n') next();
while ((c = peek()) != '\r' && c != '\n' && c != Character.MAX_VALUE) next();
}
/** Skips the block comment starting at the current position. */
@@ -367,6 +367,7 @@ public class JSONParser {
next();
do {
c = peek();
if (c == Character.MAX_VALUE) raise("Unterminated comment");
next();
if (c == '*' && peek() == '/') {
next();