File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ private char next() throws ParseError {
79
79
}
80
80
81
81
private char peek () {
82
- return offset < length ? src .charAt (offset ) : ( char ) - 1 ;
82
+ return offset < length ? src .charAt (offset ) : Character . MAX_VALUE ;
83
83
}
84
84
85
85
private JSONValue readValue () throws ParseError {
@@ -356,7 +356,7 @@ private void skipLineComment() throws ParseError {
356
356
char c ;
357
357
next ();
358
358
next ();
359
- while ((c = peek ()) != '\r' && c != '\n' ) next ();
359
+ while ((c = peek ()) != '\r' && c != '\n' && c != Character . MAX_VALUE ) next ();
360
360
}
361
361
362
362
/** Skips the block comment starting at the current position. */
@@ -367,6 +367,7 @@ private void skipBlockComment() throws ParseError {
367
367
next ();
368
368
do {
369
369
c = peek ();
370
+ if (c == Character .MAX_VALUE ) raise ("Unterminated comment" );
370
371
next ();
371
372
if (c == '*' && peek () == '/' ) {
372
373
next ();
You can’t perform that action at this time.
0 commit comments