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:
Nathan Sidwell 2020-11-03 08:32:42 -08:00
parent 84ed8d2c88
commit 082a7b2390
1 changed files with 1 additions and 1 deletions

View File

@ -1062,7 +1062,7 @@ _cpp_clean_line (cpp_reader *pfile)
d = (uchar *) s;
/* Handle DOS line endings. */
if (*s == '\r' && s != buffer->rlimit && s[1] == '\n')
if (*s == '\r' && s + 1 != buffer->rlimit && s[1] == '\n')
s++;
}