projects
/
gcc.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
84ed8d2
)
cpplib: Fix off-by-one error
author
Nathan Sidwell
<nathan@acm.org>
Tue, 3 Nov 2020 16:32:42 +0000
(08:32 -0800)
committer
Nathan Sidwell
<nathan@acm.org>
Tue, 3 Nov 2020 16:49:25 +0000
(08:49 -0800)
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.
libcpp/lex.c
patch
|
blob
|
history
diff --git
a/libcpp/lex.c
b/libcpp/lex.c
index fb222924c8c69fdbae2331df14f2f9b63a46b6ce..1d522030a3c76512a22c8b7119061a60fe853c1e 100644
(file)
--- a/
libcpp/lex.c
+++ b/
libcpp/lex.c
@@
-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++;
}