From 1f14ba44fa94017d8fe5fe311fc7997e29534e2c Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Wed, 18 Jul 2012 11:15:22 +1000 Subject: strncat was being used with incorrect length argument. Result is always safely limited so use strcat instead. --- src/Editor.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/Editor.cxx b/src/Editor.cxx index 3fabf1ab7..44226d11b 100644 --- a/src/Editor.cxx +++ b/src/Editor.cxx @@ -5889,11 +5889,11 @@ void Editor::CopySelectionRange(SelectionText *ss, bool allowLineCopy) { char *textWithEndl = new char[textLen]; textWithEndl[0] = '\0'; if (text) - strncat(textWithEndl, text, textLen); + strcat(textWithEndl, text); if (pdoc->eolMode != SC_EOL_LF) - strncat(textWithEndl, "\r", textLen); + strcat(textWithEndl, "\r"); if (pdoc->eolMode != SC_EOL_CR) - strncat(textWithEndl, "\n", textLen); + strcat(textWithEndl, "\n"); ss->Set(textWithEndl, static_cast(strlen(textWithEndl) + 1), pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true); delete []text; -- cgit v1.2.3