summaryrefslogtreecommitdiff
path: root/protocols/MSN
diff options
context:
space:
mode:
authorTobias Weimer <wishmaster51@googlemail.com>2013-05-17 18:37:52 +0000
committerTobias Weimer <wishmaster51@googlemail.com>2013-05-17 18:37:52 +0000
commitfd7c1c859ec0dc972b1ca881eda14ea950cdb649 (patch)
treea5d09e22f84869149f7c91f755cd139da685dcbf /protocols/MSN
parent28697b72eb3b0f46539f9b74393b6c67c17f5c11 (diff)
- Fixed loops
git-svn-id: http://svn.miranda-ng.org/main/trunk@4707 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/MSN')
-rw-r--r--protocols/MSN/src/msn_lists.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/protocols/MSN/src/msn_lists.cpp b/protocols/MSN/src/msn_lists.cpp
index 1f6134e2b7..92b490f6e7 100644
--- a/protocols/MSN/src/msn_lists.cpp
+++ b/protocols/MSN/src/msn_lists.cpp
@@ -238,11 +238,12 @@ void CMsnProto::Lists_Remove(int list, const char* email)
void CMsnProto::Lists_Populate(void)
{
- for (HANDLE hContact = db_find_first(m_szModuleName); hContact; hContact = db_find_next(hContact, m_szModuleName)) {
- char szEmail[MSN_MAX_EMAIL_LEN] = "";;
+ HANDLE hContact = db_find_first(m_szModuleName);
+ while (hContact) {
+ HANDLE hNext = db_find_next(hContact, m_szModuleName);
+ char szEmail[MSN_MAX_EMAIL_LEN] = "";
if (getStaticString(hContact, "wlid", szEmail, sizeof(szEmail)))
getStaticString(hContact, "e-mail", szEmail, sizeof(szEmail));
-
if (szEmail[0]) {
bool localList = getByte(hContact, "LocalList", 0) != 0;
if (localList)
@@ -251,6 +252,7 @@ void CMsnProto::Lists_Populate(void)
Lists_Add(0, NETID_UNKNOWN, szEmail, hContact);
}
else CallService(MS_DB_CONTACT_DELETE, (WPARAM)hContact, 0);
+ hContact = hNext;
}
}