summaryrefslogtreecommitdiff
path: root/plugins/Spamotron
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2017-01-17 17:19:19 +0300
committerGeorge Hazan <ghazan@miranda.im>2017-01-17 17:19:19 +0300
commitb327ed7872ca83c3a4249039ba1a3d8dd3ece630 (patch)
tree5a4ae83dafab23f7832186b5dd0736611998f43c /plugins/Spamotron
parentfd7566b5de6b59bb18ff380cb1fa3f3f1089b70b (diff)
useless field DBEVENTINFO::cbSize removed
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r--plugins/Spamotron/src/spamotron.cpp1
-rw-r--r--plugins/Spamotron/src/utils.cpp9
2 files changed, 3 insertions, 7 deletions
diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp
index fe48153a0e..3cf7247c4a 100644
--- a/plugins/Spamotron/src/spamotron.cpp
+++ b/plugins/Spamotron/src/spamotron.cpp
@@ -244,7 +244,6 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam)
_dbei->szModule = szAuthEventModule;
_dbei->timestamp = dbei->timestamp;
_dbei->flags = 0;
- _dbei->cbSize = sizeof(DBEVENTINFO);
_dbei->pBlob = _dbv.pbVal + sizeof(DWORD);
db_event_add(hContact,_dbei);
db_unset(hContact, PLUGIN_NAME, "AuthEvent");
diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp
index a95f2a976f..fd963d0aa5 100644
--- a/plugins/Spamotron/src/utils.cpp
+++ b/plugins/Spamotron/src/utils.cpp
@@ -458,11 +458,11 @@ int LogToSystemHistory(char *message, char *origmessage)
{
char msg[MAX_BUFFER_LENGTH];
time_t tm;
- DBEVENTINFO dbei;
if (message == NULL)
return 0;
- dbei.cbSize = sizeof(DBEVENTINFO);
+
+ DBEVENTINFO dbei = {};
dbei.timestamp = time(&tm);
dbei.szModule = PLUGIN_NAME;
dbei.pBlob = (PBYTE)msg;
@@ -488,10 +488,7 @@ void MarkUnread(MCONTACT hContact)
if (db_get(hContact, PLUGIN_NAME, "LastMsgEvents", &_dbv) == 0) {
pos = _dbv.pbVal;
while (pos - _dbv.pbVal < _dbv.cpbVal) {
- DBEVENTINFO _dbei;
- memset(&_dbei, 0, sizeof(_dbei));
- _dbei.cbSize = sizeof(_dbei);
-
+ DBEVENTINFO _dbei = {};
memcpy(&_dbei.eventType, pos, sizeof(WORD)); pos += sizeof(WORD);
memcpy(&_dbei.flags, pos, sizeof(DWORD)); pos += sizeof(DWORD);
memcpy(&_dbei.timestamp, pos, sizeof(DWORD)); pos += sizeof(DWORD);