diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2016-03-16 18:35:26 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2016-03-16 18:35:26 +0000 |
commit | cf0b0b736cea27c86850a8b3485bc200bddb35ca (patch) | |
tree | fa4d5a24df04bc5e2aacb438f1d6b0d5e616715b /plugins/Dbx_mdb/src/dbsettings.cpp | |
parent | 0cf6c3523f81dc179363b6184175573640f7554c (diff) |
dbx_lmdb: crutches removed; crash fix (?)
git-svn-id: http://svn.miranda-ng.org/main/trunk@16488 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dbx_mdb/src/dbsettings.cpp')
-rw-r--r-- | plugins/Dbx_mdb/src/dbsettings.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
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);
}
|