diff options
author | ray <ray@FreeBSD.org> | 2013-12-05 00:57:53 +0000 |
---|---|---|
committer | ray <ray@FreeBSD.org> | 2013-12-05 00:57:53 +0000 |
commit | 1af064917e022f18acbf9fc2942cd40f1b26fbe5 (patch) | |
tree | ef10954b063bcd6939eabdcc7ecba95432634f70 /contrib/gcclibs/libcpp/charset.c | |
parent | 40d47a9dd8116c90080a010ab3483d8917bd0524 (diff) | |
parent | 6e411c7e1916ef76b0aa51ded38fa235d3313371 (diff) | |
download | FreeBSD-src-1af064917e022f18acbf9fc2942cd40f1b26fbe5.zip FreeBSD-src-1af064917e022f18acbf9fc2942cd40f1b26fbe5.tar.gz |
MFC @r258947.
Sponsored by: The FreeBSD Foundation
Diffstat (limited to 'contrib/gcclibs/libcpp/charset.c')
-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 78c8981..6361f8c 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'; |