summaryrefslogtreecommitdiff
path: root/protocols/MSN/src/msn_lists.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'protocols/MSN/src/msn_lists.cpp')
-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;
}
}