summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkili <kili@openbsd.org>2010-06-06 12:04:15 +0000
committerkili <kili@openbsd.org>2010-06-06 12:04:15 +0000
commit1c4aaf6cd14a97342bfb0950f36366339645d326 (patch)
treec6417eda11daef44d65d7763c565d47783cadc9a
parentNuke common. (diff)
downloadwireguard-openbsd-1c4aaf6cd14a97342bfb0950f36366339645d326.tar.xz
wireguard-openbsd-1c4aaf6cd14a97342bfb0950f36366339645d326.zip
Yet another underflow. Found while hunting down the ICEs that happen
from time to time when building the www/larbin port. This is an independent bugfix, and it's different from 4.5.0. ok espie@
-rw-r--r--gnu/gcc/libcpp/charset.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gnu/gcc/libcpp/charset.c b/gnu/gcc/libcpp/charset.c
index 78c89816735..6361f8c5132 100644
--- a/gnu/gcc/libcpp/charset.c
+++ b/gnu/gcc/libcpp/charset.c
@@ -1628,7 +1628,7 @@ _cpp_convert_input (cpp_reader *pfile, const char *input_charset,
terminate with another \r, not an \n, so that we do not mistake
the \r\n sequence for a single DOS line ending and erroneously
issue the "No newline at end of file" diagnostic. */
- if (to.text[to.len - 1] == '\r')
+ if (to.len > 0 && to.text[to.len - 1] == '\r')
to.text[to.len] = '\r';
else
to.text[to.len] = '\n';