From 046d1d2dcefe90b80b58330c043be32d7ef49d49 Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Thu, 11 Mar 2010 10:07:06 +0000 Subject: Using passed length rather than 0 termination in case need to process text containing NULs. --- src/Document.cxx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/Document.cxx b/src/Document.cxx index 8af819271..954ff9daf 100644 --- a/src/Document.cxx +++ b/src/Document.cxx @@ -845,7 +845,7 @@ char *Document::TransformLineEnds(int *pLenOut, const char *s, size_t len, int e char *dest = new char[2 * len + 1]; const char *sptr = s; char *dptr = dest; - for (size_t i = 0; (i < len) && (*sptr != '\0'); i++) { + for (size_t i = 0; i < len; i++) { if (*sptr == '\n' || *sptr == '\r') { if (eolMode == SC_EOL_CR) { *dptr++ = '\r'; -- cgit v1.2.3