From cf0b0b736cea27c86850a8b3485bc200bddb35ca Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 16 Mar 2016 18:35:26 +0000 Subject: dbx_lmdb: crutches removed; crash fix (?) git-svn-id: http://svn.miranda-ng.org/main/trunk@16488 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dbx_mdb/src/dbsettings.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'plugins/Dbx_mdb/src/dbsettings.cpp') diff --git a/plugins/Dbx_mdb/src/dbsettings.cpp b/plugins/Dbx_mdb/src/dbsettings.cpp index 623bea9024..6ea4d009cb 100644 --- a/plugins/Dbx_mdb/src/dbsettings.cpp +++ b/plugins/Dbx_mdb/src/dbsettings.cpp @@ -562,7 +562,7 @@ STDMETHODIMP_(BOOL) CDbxMdb::EnumContactSettings(MCONTACT contactID, DBCONTACTEN if (!dbces->szModule) return -1; - int result = 0; + int result = -1; DBSettingKey keySearch; keySearch.dwContactID = contactID; @@ -577,17 +577,15 @@ STDMETHODIMP_(BOOL) CDbxMdb::EnumContactSettings(MCONTACT contactID, DBCONTACTEN if (mdb_cursor_get(cursor, &key, &data, MDB_SET_RANGE) == MDB_SUCCESS) { - size_t i = 0; do { const DBSettingKey *pKey = (const DBSettingKey*)key.mv_data; if (pKey->dwContactID != contactID || pKey->dwOfsModule != keySearch.dwOfsModule) - return i == 0 ? -1 : result; + return result; char szSetting[256]; strncpy_s(szSetting, pKey->szSettingName, key.mv_size - sizeof(DWORD) * 2); result = (dbces->pfnEnumProc)(szSetting, dbces->lParam); - i++; } while (mdb_cursor_get(cursor, &key, &data, MDB_NEXT) == MDB_SUCCESS); } -- cgit v1.2.3