summaryrefslogtreecommitdiff
path: root/plugins/Msg_Export/src/utils.cpp
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2015-06-19 18:39:18 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2015-06-19 18:39:18 +0000
commitd0dca507c9fc51b566e73fac8c2827daaed441b1 (patch)
tree93461039fc77ea03e886f0513b8c6639fc9254ab /plugins/Msg_Export/src/utils.cpp
parentbf37d6655a27cc3ea5af5412c9717596c9d1c30f (diff)
MsgExport:
- fixed truncation of exported messages (#939) - minor other fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@14267 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Msg_Export/src/utils.cpp')
-rwxr-xr-xplugins/Msg_Export/src/utils.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/Msg_Export/src/utils.cpp b/plugins/Msg_Export/src/utils.cpp
index 65b86fc401..023c90a90b 100755
--- a/plugins/Msg_Export/src/utils.cpp
+++ b/plugins/Msg_Export/src/utils.cpp
@@ -445,8 +445,7 @@ static bool bWriteTextToFile(HANDLE hFile, const TCHAR *pszSrc, bool bUtf8File,
{
if (nLen != -1) {
TCHAR *tmp = (TCHAR*)alloca(sizeof(TCHAR)*(nLen + 1));
- mir_tstrncpy(tmp, pszSrc, nLen);
- tmp[nLen] = 0;
+ mir_tstrncpy(tmp, pszSrc, nLen + 1);
pszSrc = tmp;
}
@@ -468,8 +467,7 @@ static bool bWriteTextToFile(HANDLE hFile, const char *pszSrc, bool bUtf8File, i
if (nLen != -1) {
char *tmp = (char*)alloca(nLen + 1);
- mir_strncpy(tmp, pszSrc, nLen);
- tmp[nLen] = 0;
+ mir_strncpy(tmp, pszSrc, nLen + 1);
pszSrc = tmp;
}