diff options
author | George Hazan <ghazan@miranda.im> | 2018-09-02 21:19:21 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2018-09-02 21:19:21 +0300 |
commit | 13f877a119970c028a9c29dc624a524ada906c87 (patch) | |
tree | ab18e275630b763ff7e5843f610c8925ac9c7d60 /src/mir_app | |
parent | a1edd77afc2b3ae486eb1dfaef2d4c69bb9d9006 (diff) |
30 chars aren't enough for long date representation
Diffstat (limited to 'src/mir_app')
-rw-r--r-- | src/mir_app/src/chat_log.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/mir_app/src/chat_log.cpp b/src/mir_app/src/chat_log.cpp index 46b9d5be4a..5c0f4aed89 100644 --- a/src/mir_app/src/chat_log.cpp +++ b/src/mir_app/src/chat_log.cpp @@ -285,7 +285,7 @@ static void AddEventToBuffer(CMStringA &buf, LOGSTREAMDATA *streamData) wchar_t* MakeTimeStamp(wchar_t *pszStamp, time_t time)
{
- static wchar_t szTime[30];
+ static wchar_t szTime[100];
if (!wcsftime(szTime, _countof(szTime)-1, pszStamp, localtime(&time)))
wcsncpy_s(szTime, TranslateT("<invalid>"), _TRUNCATE);
return szTime;
@@ -343,10 +343,10 @@ char* Log_CreateRTF(LOGSTREAMDATA *streamData) //insert timestamp
if (g_Settings->bShowTime) {
- wchar_t szTimeStamp[30], szOldTimeStamp[30];
+ wchar_t szTimeStamp[100], szOldTimeStamp[100];
- mir_wstrncpy(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), 30);
- mir_wstrncpy(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, si->LastTime), 30);
+ wcsncpy_s(szTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, lin->time), _TRUNCATE);
+ wcsncpy_s(szOldTimeStamp, MakeTimeStamp(g_Settings->pszTimeStamp, si->LastTime), _TRUNCATE);
if (!g_Settings->bShowTimeIfChanged || si->LastTime == 0 || mir_wstrcmp(szTimeStamp, szOldTimeStamp)) {
si->LastTime = lin->time;
Log_AppendRTF(streamData, TRUE, buf, L"%s", szTimeStamp);
|