summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdbx/src
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-03-24 18:23:45 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-03-24 18:23:45 +0300
commite00ad4b063b61ae162ccdc603b29f40853490250 (patch)
tree290349329554410f0a697035bd42acbf953f2200 /plugins/Dbx_mdbx/src
parentc7e4da1e39a2749e29e650f0bf16adfb1f4695a2 (diff)
Dbx_mdbx: fix for a nasty problem with message ids
Diffstat (limited to 'plugins/Dbx_mdbx/src')
-rw-r--r--plugins/Dbx_mdbx/src/dbevents.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/Dbx_mdbx/src/dbevents.cpp b/plugins/Dbx_mdbx/src/dbevents.cpp
index c720609e25..78d1531a29 100644
--- a/plugins/Dbx_mdbx/src/dbevents.cpp
+++ b/plugins/Dbx_mdbx/src/dbevents.cpp
@@ -435,7 +435,12 @@ MEVENT CDbxMDBX::GetEventById(LPCSTR szModule, LPCSTR szId)
if (mdbx_get(txn, m_dbEventIds, &key, &data) != MDBX_SUCCESS)
return 0;
- return *(MEVENT*)data.iov_base;
+ MEVENT hDbEvent = *(MEVENT *)data.iov_base;
+ MDBX_val key2 = { &hDbEvent, sizeof(MEVENT) }, data2;
+ if (mdbx_get(txn, m_dbEvents, &key2, &data2) != MDBX_SUCCESS)
+ return 0;
+
+ return hDbEvent;
}
BOOL CDbxMDBX::SetEventId(LPCSTR szModule, MEVENT hDbEvent, LPCSTR szId)