aboutsummaryrefslogtreecommitdiff
path: root/NorthstarDLL/localchatwriter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'NorthstarDLL/localchatwriter.cpp')
-rw-r--r--NorthstarDLL/localchatwriter.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/NorthstarDLL/localchatwriter.cpp b/NorthstarDLL/localchatwriter.cpp
index 7f5e2a0a..62543b95 100644
--- a/NorthstarDLL/localchatwriter.cpp
+++ b/NorthstarDLL/localchatwriter.cpp
@@ -280,12 +280,11 @@ void LocalChatWriter::Write(const char* str)
if (startOfEscape != str)
{
// There is some text before the escape sequence, just print that
-
size_t copyChars = startOfEscape - str;
if (copyChars > 255)
copyChars = 255;
- strncpy(writeBuffer, str, copyChars);
- writeBuffer[copyChars] = 0;
+
+ strncpy_s(writeBuffer, copyChars + 1, str, copyChars);
InsertText(writeBuffer);
}