cpplib: Fix off-by-one error
I noticed a fencepost error in the preprocessor. We should be checking if the next char is at the limit, not the current char (which can't be, because we're looking at it). libcpp/ * lex.c (_cpp_clean_line): Fix DOS off-by-one error.
This commit is contained in:
parent
84ed8d2c88
commit
082a7b2390
|
@ -1062,7 +1062,7 @@ _cpp_clean_line (cpp_reader *pfile)
|
||||||
d = (uchar *) s;
|
d = (uchar *) s;
|
||||||
|
|
||||||
/* Handle DOS line endings. */
|
/* Handle DOS line endings. */
|
||||||
if (*s == '\r' && s != buffer->rlimit && s[1] == '\n')
|
if (*s == '\r' && s + 1 != buffer->rlimit && s[1] == '\n')
|
||||||
s++;
|
s++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue