From a22596e0a8d424b18c5396b6584de57cccd180c6 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 23 May 2016 08:56:07 +0000 Subject: fix for a typo git-svn-id: http://svn.miranda-ng.org/main/trunk@16860 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Sessions/Src/Main.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/Sessions/Src/Main.cpp b/plugins/Sessions/Src/Main.cpp index f1263a92aa..765c791e05 100644 --- a/plugins/Sessions/Src/Main.cpp +++ b/plugins/Sessions/Src/Main.cpp @@ -316,11 +316,9 @@ INT_PTR CALLBACK LoadSessionDlgProc(HWND hdlg, UINT msg, WPARAM wparam, LPARAM) case IDC_SESSDEL: if (session_list_recovered[0] && ses_count == 256) { - int i = 0; - while (session_list_recovered[i]) { + for (int i = 0; session_list_recovered[i]; i++) db_set_b(session_list_recovered[i], MODNAME, "wasInLastSession", 0); - i++; - } + memset(session_list_recovered, 0, sizeof(session_list_recovered)); g_bIncompletedSave = 0; @@ -695,12 +693,14 @@ static int GetContactHandle(WPARAM, LPARAM lParam) if (MWeventdata->uType == MSG_WINDOW_EVT_OPEN) { if (strstr(MWeventdata->szModule, "tabSRMsg")) g_mode = 1; AddToCurSession(MWeventdata->hContact, 0); - if (g_bCrashRecovery) db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 1); + if (g_bCrashRecovery) + db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 1); } else if (MWeventdata->uType == MSG_WINDOW_EVT_CLOSE) { if (!DONT) DelFromCurSession(MWeventdata->hContact, 0); - if (g_bCrashRecovery) db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 0); + if (g_bCrashRecovery) + db_set_b(MWeventdata->hContact, MODNAME, "wasInLastSession", 0); } return 0; @@ -868,7 +868,7 @@ extern "C" __declspec(dllexport) int Load(void) g_bCrashRecovery = db_get_b(NULL, MODNAME, "CrashRecovery", 0) != 0; if (g_bCrashRecovery) - g_bIncompletedSave = !db_get_b(NULL, MODNAME, "lastSaveCompleted", 0) != 0; + g_bIncompletedSave = db_get_b(NULL, MODNAME, "lastSaveCompleted", 0) == 0; if (g_bIncompletedSave) { int i = 0; -- cgit v1.2.3