diff options
author | Pedro F. Giffuni <pfg@FreeBSD.org> | 2013-11-28 16:36:03 +0000 |
---|---|---|
committer | Pedro F. Giffuni <pfg@FreeBSD.org> | 2013-11-28 16:36:03 +0000 |
commit | 729f64d6ae27142cfc8f2bcc0e69330a9499e480 (patch) | |
tree | a31545ed205eafbfbb61ae2622ce8fa150ae1f68 /contrib/gcclibs | |
parent | a19b3f74af5bcfac2e564ef50665f5ba086958b1 (diff) |
Notes
Diffstat (limited to 'contrib/gcclibs')
-rw-r--r-- | contrib/gcclibs/libcpp/charset.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/contrib/gcclibs/libcpp/charset.c b/contrib/gcclibs/libcpp/charset.c index 78c89816735a..6361f8c51321 100644 --- a/contrib/gcclibs/libcpp/charset.c +++ b/contrib/gcclibs/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'; |