mirror of
https://gitee.com/openharmony/third_party_jsoncpp
synced 2024-10-06 21:43:56 +00:00
commit
fb474c547c
@ -772,6 +772,10 @@ void Reader::getLocationLineAndColumn(Location location, int& line,
|
||||
while (current < location && current != end_) {
|
||||
Char c = *current++;
|
||||
if (c == '\r') {
|
||||
// Add boundary check to avoid cross the border
|
||||
if (current == end_) {
|
||||
break;
|
||||
}
|
||||
if (*current == '\n')
|
||||
++current;
|
||||
lastLineStart = current;
|
||||
@ -1838,6 +1842,10 @@ void OurReader::getLocationLineAndColumn(Location location, int& line,
|
||||
while (current < location && current != end_) {
|
||||
Char c = *current++;
|
||||
if (c == '\r') {
|
||||
// Add boundary check to avoid cross the border
|
||||
if (current == end_) {
|
||||
break;
|
||||
}
|
||||
if (*current == '\n')
|
||||
++current;
|
||||
lastLineStart = current;
|
||||
|
Loading…
Reference in New Issue
Block a user