summaryrefslogtreecommitdiff
path: root/plugins/Spamotron
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
committerGeorge Hazan <ghazan@miranda.im>2021-12-26 17:06:04 +0300
commit1039b2829a264280493ba0fa979214fe024dc70c (patch)
tree8fa6a60eb46627582c372b56a4a1d4754d6732c3 /plugins/Spamotron
parent62a186697df33c96dc1a6dac0f4dfc38652fb96f (diff)
WORD -> uint16_t
Diffstat (limited to 'plugins/Spamotron')
-rw-r--r--plugins/Spamotron/src/spamotron.cpp14
-rw-r--r--plugins/Spamotron/src/utils.cpp2
2 files changed, 8 insertions, 8 deletions
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);