From eb146b049b43c6fb09e6f8c7716c1bbc88bf2159 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 17 Jul 2012 06:03:16 +0000 Subject: memory corruption fix git-svn-id: http://svn.miranda-ng.org/main/trunk@999 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Sessions/Src/Main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins') diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index 9e3f84c8d3..23636235ae 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -540,8 +540,8 @@ int SaveSessionDate() TCHAR *szDateBuf = (TCHAR*)mir_alloc((DateSize+1)*sizeof(TCHAR)); GetDateFormat(LOCALE_USER_DEFAULT, DATE_SHORTDATE, NULL, NULL, szDateBuf, DateSize ); - TCHAR *szSessionTime = (TCHAR*)mir_alloc((DateSize+TimeSize+5)*sizeof(TCHAR)); - int lenn = (int)_tcslen(szSessionTime); + int lenn = (DateSize+TimeSize+5); + TCHAR *szSessionTime = (TCHAR*)mir_alloc(lenn*sizeof(TCHAR)); mir_sntprintf(szSessionTime, lenn, _T("%s - %s"), szTimeBuf, szDateBuf); char szSessionDate[256]; -- cgit v1.2.3