summaryrefslogtreecommitdiff
path: root/plugins/WebView/src/webview_getdata.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2013-07-28 20:46:17 +0000
committerGeorge Hazan <george.hazan@gmail.com>2013-07-28 20:46:17 +0000
commitcd93f0bad584bd4c27d8d9ad5e067353554903c2 (patch)
treea7f45fc4f4f79a7d9ba98eccdac7c25961ac2f06 /plugins/WebView/src/webview_getdata.cpp
parented88be7be4129fd6d539d4f7318977621ffde251 (diff)
crazy database reading code removed
git-svn-id: http://svn.miranda-ng.org/main/trunk@5520 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WebView/src/webview_getdata.cpp')
-rw-r--r--plugins/WebView/src/webview_getdata.cpp11
1 files changed, 6 insertions, 5 deletions
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) {