aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2012-07-18 11:15:22 +1000
committernyamatongwe <unknown>2012-07-18 11:15:22 +1000
commit1f14ba44fa94017d8fe5fe311fc7997e29534e2c (patch)
treed15395f64e59c8b58828d8a6989c137a59d7ab7c
parent974bf5b2478842e03d66e8cbb5dbccbf32dcda7b (diff)
downloadscintilla-mirror-1f14ba44fa94017d8fe5fe311fc7997e29534e2c.tar.gz
strncat was being used with incorrect length argument. Result is always
safely limited so use strcat instead.
-rw-r--r--src/Editor.cxx6
1 files changed, 3 insertions, 3 deletions
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<int>(strlen(textWithEndl) + 1),
pdoc->dbcsCodePage, vs.styles[STYLE_DEFAULT].characterSet, false, true);
delete []text;