summaryrefslogtreecommitdiff
path: root/plugins/Dbx_mdb/src/dbcontacts.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-12 21:16:52 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-12 21:16:52 +0000
commit3f5208b9147b32ddcf259ec8bb3fb280192928f8 (patch)
tree18556c5846701e85403843f4bc66422dcdb3bf6a /plugins/Dbx_mdb/src/dbcontacts.cpp
parent0eab78fa8138134301a4887d292f5c2e4c260a34 (diff)
fix for reading
git-svn-id: http://svn.miranda-ng.org/main/trunk@11846 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbcontacts.cpp')
-rw-r--r--plugins/Dbx_mdb/src/dbcontacts.cpp11
1 files changed, 4 insertions, 7 deletions
diff --git a/plugins/Dbx_mdb/src/dbcontacts.cpp b/plugins/Dbx_mdb/src/dbcontacts.cpp
index 88a31f58d7..fbb3c89276 100644
--- a/plugins/Dbx_mdb/src/dbcontacts.cpp
+++ b/plugins/Dbx_mdb/src/dbcontacts.cpp
@@ -165,21 +165,18 @@ void CDbxMdb::FillContacts()
MDB_txn *txn;
mdb_txn_begin(m_pMdbEnv, NULL, MDB_RDONLY, &txn);
+ mdb_open(txn, "contacts", MDB_CREATE | MDB_INTEGERKEY, &m_dbContacts);
MDB_cursor *cursor;
mdb_cursor_open(txn, m_dbContacts, &cursor);
- DWORD dwContactId;
- DBContact value;
-
MDB_val key, data;
- key.mv_size = sizeof(DWORD); key.mv_data = &dwContactId;
- data.mv_size = sizeof(DBContact); data.mv_data = &value;
-
while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == 0) {
- if (value.signature != DBCONTACT_SIGNATURE)
+ DBContact *dbc = (DBContact*)data.mv_data;
+ if (dbc->signature != DBCONTACT_SIGNATURE)
DatabaseCorruption(NULL);
+ DWORD dwContactId = *(DWORD*)key.mv_data;
DBCachedContact *cc = m_cache->AddContactToCache(dwContactId);
cc->dwDriverData = 0;
CheckProto(cc, "");