summaryrefslogtreecommitdiff
path: root/src/modules/chat/chat_rtf.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules/chat/chat_rtf.cpp')
-rw-r--r--src/modules/chat/chat_rtf.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/modules/chat/chat_rtf.cpp b/src/modules/chat/chat_rtf.cpp
index 2cff984c84..8373a833d5 100644
--- a/src/modules/chat/chat_rtf.cpp
+++ b/src/modules/chat/chat_rtf.cpp
@@ -167,16 +167,11 @@ int DoRtfToTags(CMString &pszText, int iNumColors, COLORREF *pColors)
}
else if (p[1] == '\'') { // special character
if (p[2] != ' ' && p[2] != '\\') {
- TCHAR tmp[10];
-
- if (p[3] != ' ' && p[3] != '\\') {
- _tcsncpy(tmp, p + 2, 3);
- tmp[3] = 0;
- }
- else {
- _tcsncpy(tmp, p + 2, 2);
- tmp[2] = 0;
- }
+ TCHAR tmp[10], *t = tmp;
+ *t++ = p[2];
+ if (p[3] != ' ' && p[3] != '\\')
+ *t++ = p[3];
+ *t = 0;
// convert string containing char in hex format to int.
TCHAR *stoppedHere;