From cd93f0bad584bd4c27d8d9ad5e067353554903c2 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 28 Jul 2013 20:46:17 +0000 Subject: crazy database reading code removed git-svn-id: http://svn.miranda-ng.org/main/trunk@5520 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/WebView/src/webview_getdata.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'plugins/WebView/src/webview_getdata.cpp') diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 601f2b686f..4522eee824 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -147,8 +147,9 @@ void GetData(HANDLE hContact) db_set_ts(hContact, "CList", "StatusMsg", statusText); } if (nlhrReply->dataLength) { - szInfo = (char*)malloc(lstrlenA(nlhrReply->pData) + 2); - lstrcpynA(szInfo, nlhrReply->pData, lstrlenA(nlhrReply->pData)); + int cbLen = lstrlenA(nlhrReply->pData); + szInfo = (char*)malloc(cbLen + 2); + lstrcpynA(szInfo, nlhrReply->pData, cbLen); downloadsize = lstrlenA(nlhrReply->pData); trunccount = 0; @@ -326,11 +327,11 @@ void GetData(HANDLE hContact) ftime = time(NULL); nTime = localtime(&ftime); - mir_snprintf(timeprefix, SIZEOF(timeprefix), " %s ", Translate("Last updated on")); + strncpy_s(timeprefix, SIZEOF(timeprefix), Translate("Last updated on"), _TRUNCATE); + strncpy_s(timeat, SIZEOF(timeat), Translate("at the time"), _TRUNCATE); strftime(temptime1, 32, " %a, %b %d, %Y ", nTime); - mir_snprintf(timeat, SIZEOF(timeat), "%s", Translate("at the time")); strftime(temptime2, 32, " %I:%M %p.", nTime); - mir_snprintf(timestring, SIZEOF(timestring), "%s%s%s%s", timeprefix, temptime1, timeat, temptime2); + mir_snprintf(timestring, SIZEOF(timestring), " %s %s%s%s", timeprefix, temptime1, timeat, temptime2); } // end download success if (DownloadSuccess) { -- cgit v1.2.3