From 1039b2829a264280493ba0fa979214fe024dc70c Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sun, 26 Dec 2021 17:06:04 +0300 Subject: WORD -> uint16_t --- plugins/Spamotron/src/spamotron.cpp | 14 +++++++------- plugins/Spamotron/src/utils.cpp | 2 +- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/Spamotron/src') diff --git a/plugins/Spamotron/src/spamotron.cpp b/plugins/Spamotron/src/spamotron.cpp index d155dcd097..f22e25b595 100644 --- a/plugins/Spamotron/src/spamotron.cpp +++ b/plugins/Spamotron/src/spamotron.cpp @@ -439,7 +439,7 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) else { if (g_plugin.getByte("MarkMsgUnreadOnApproval", defaultMarkMsgUnreadOnApproval)) { DBVARIANT _dbv; - DWORD dbei_size = 3 * sizeof(DWORD) + sizeof(WORD) + dbei->cbBlob + (DWORD)mir_strlen(dbei->szModule) + 1; + DWORD dbei_size = 3 * sizeof(DWORD) + sizeof(uint16_t) + dbei->cbBlob + (DWORD)mir_strlen(dbei->szModule) + 1; uint8_t *eventdata = (uint8_t*)malloc(dbei_size); uint8_t *pos = eventdata; if (eventdata != nullptr && dbei->cbBlob > 0) { @@ -450,12 +450,12 @@ int OnDBEventFilterAdd(WPARAM wParam, LPARAM lParam) pos += _dbv.cpbVal; db_free(&_dbv); } - memcpy(pos, &dbei->eventType, sizeof(WORD)); - memcpy(pos + sizeof(WORD), &dbei->flags, sizeof(DWORD)); - memcpy(pos + sizeof(WORD) + sizeof(DWORD), &dbei->timestamp, sizeof(DWORD)); - memcpy(pos + sizeof(WORD) + sizeof(DWORD) * 2, dbei->szModule, mir_strlen(dbei->szModule) + 1); - memcpy(pos + sizeof(WORD) + sizeof(DWORD) * 2 + mir_strlen(dbei->szModule) + 1, &dbei->cbBlob, sizeof(DWORD)); - memcpy(pos + sizeof(WORD) + sizeof(DWORD) * 3 + mir_strlen(dbei->szModule) + 1, dbei->pBlob, dbei->cbBlob); + memcpy(pos, &dbei->eventType, sizeof(uint16_t)); + memcpy(pos + sizeof(uint16_t), &dbei->flags, sizeof(DWORD)); + memcpy(pos + sizeof(uint16_t) + sizeof(DWORD), &dbei->timestamp, sizeof(DWORD)); + memcpy(pos + sizeof(uint16_t) + sizeof(DWORD) * 2, dbei->szModule, mir_strlen(dbei->szModule) + 1); + memcpy(pos + sizeof(uint16_t) + sizeof(DWORD) * 2 + mir_strlen(dbei->szModule) + 1, &dbei->cbBlob, sizeof(DWORD)); + memcpy(pos + sizeof(uint16_t) + sizeof(DWORD) * 3 + mir_strlen(dbei->szModule) + 1, dbei->pBlob, dbei->cbBlob); db_set_blob(hContact, MODULENAME, "LastMsgEvents", eventdata, (pos - eventdata) + dbei_size); free(eventdata); } diff --git a/plugins/Spamotron/src/utils.cpp b/plugins/Spamotron/src/utils.cpp index c29132d7b7..506dfec548 100644 --- a/plugins/Spamotron/src/utils.cpp +++ b/plugins/Spamotron/src/utils.cpp @@ -489,7 +489,7 @@ void MarkUnread(MCONTACT hContact) pos = _dbv.pbVal; while (pos - _dbv.pbVal < _dbv.cpbVal) { DBEVENTINFO dbei = {}; - memcpy(&dbei.eventType, pos, sizeof(WORD)); pos += sizeof(WORD); + memcpy(&dbei.eventType, pos, sizeof(uint16_t)); pos += sizeof(uint16_t); memcpy(&dbei.flags, pos, sizeof(DWORD)); pos += sizeof(DWORD); memcpy(&dbei.timestamp, pos, sizeof(DWORD)); pos += sizeof(DWORD); -- cgit v1.2.3