diff options
author | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
---|---|---|
committer | Rozhuk Ivan <rozhuk.im@gmail.com> | 2014-12-01 00:07:01 +0000 |
commit | b2fad485cd5b41744ef0cc4a02722c021afd926c (patch) | |
tree | aa19403cd699066600e8306be8ad33e4a17fba6f /plugins/WebView/src/webview_getdata.cpp | |
parent | fc62f1f1e1f8af40a1f7efe0ba3afc358fb66ef3 (diff) |
ZeroMemory -> memset, few bugs fised
git-svn-id: http://svn.miranda-ng.org/main/trunk@11184 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/WebView/src/webview_getdata.cpp')
-rw-r--r-- | plugins/WebView/src/webview_getdata.cpp | 35 |
1 files changed, 18 insertions, 17 deletions
diff --git a/plugins/WebView/src/webview_getdata.cpp b/plugins/WebView/src/webview_getdata.cpp index 9de894fd3e..02c724c07d 100644 --- a/plugins/WebView/src/webview_getdata.cpp +++ b/plugins/WebView/src/webview_getdata.cpp @@ -59,13 +59,14 @@ void GetData(void *param) Startingup = 0;
- ZeroMemory(&url, sizeof(url));
- ZeroMemory(&contactname, sizeof(contactname));
- ZeroMemory(&tempstring, sizeof(tempstring));
- ZeroMemory(&tempstring2, sizeof(tempstring2));
- ZeroMemory(&dbv, sizeof(dbv));
- ZeroMemory(&tstr, sizeof(tstr));
- ZeroMemory(×tring, sizeof(timestring));
+ memset(&url, 0, sizeof(url));
+ memset(&contactname, 0, sizeof(contactname));
+ memset(&tempstring, 0, sizeof(tempstring));
+ memset(&tempstring2, 0, sizeof(tempstring2));
+ memset(&szInfo, 0, sizeof(szInfo));
+ memset(&dbv, 0, sizeof(dbv));
+ memset(&tstr, 0, sizeof(tstr));
+ memset(×tring, 0, sizeof(timestring));
db_set_b(hContact, MODULENAME, STOP_KEY, 0);
@@ -199,19 +200,19 @@ void GetData(void *param) pos = strstr(truncated2, tempstring);
statpos = pos - truncated2;
- ZeroMemory(&pos, sizeof(pos));
+ memset(&pos, 0, sizeof(pos)); // XXX: looks bad.
// end string
pos = strstr(truncated2, tempstring2);
- statposend = pos - truncated2 + (int)strlen(tempstring2);
+ statposend = pos - truncated2 + strlen(tempstring2);
if (statpos > statposend) {
memset(&truncated2, ' ', statpos);
- ZeroMemory(&pos, sizeof(pos));
+ memset(&pos, 0, sizeof(pos)); // XXX: looks bad.
pos = strstr(truncated2, tempstring2);
- statposend = pos - truncated2 + (int)strlen(tempstring2);
+ statposend = pos - truncated2 + strlen(tempstring2);
}
if (statpos < statposend) {
- ZeroMemory(&raw, sizeof(raw));
+ memset(&raw, 0, sizeof(raw));
// get size for malloc
MallocSize = statposend - statpos;
@@ -227,7 +228,7 @@ void GetData(void *param) if (statpos > statposend) {
memset(&truncated2, ' ', statpos);
- ZeroMemory(&pos, sizeof(pos));
+ memset(&pos, 0, sizeof(pos)); // XXX
pos = strstr(truncated2, tempstring2);
statposend = pos - truncated2 + (int)strlen(tempstring2);
}
@@ -285,8 +286,8 @@ void GetData(void *param) setlocale(LC_ALL, "");
if (!db_get_s(hContact, MODULENAME, PRESERVE_NAME_KEY, &dbv)) {
- ZeroMemory(&temptime, sizeof(temptime));
- ZeroMemory(&tstr, sizeof(tstr));
+ memset(&temptime, 0, sizeof(temptime));
+ memset(&tstr, 0, sizeof(tstr));
ftime = time(NULL);
nTime = localtime(&ftime);
// 12 hour
@@ -304,8 +305,8 @@ void GetData(void *param) }
else {
db_get_ts(hContact, "CList", "MyHandle", &dbv);
- ZeroMemory(&temptime, sizeof(temptime));
- ZeroMemory(&tstr, sizeof(tstr));
+ memset(&temptime, 0, sizeof(temptime));
+ memset(&tstr, 0, sizeof(tstr));
ftime = time(NULL);
nTime = localtime(&ftime);
// 12 hour
|