From f43e875851959070502a73d8313ca1586e0e54d1 Mon Sep 17 00:00:00 2001 From: Rozhuk Ivan Date: Mon, 8 Dec 2014 18:05:22 +0000 Subject: Db_autobackups: crash on rotate fix git-svn-id: http://svn.miranda-ng.org/main/trunk@11278 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Db_autobackups/src/backup.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'plugins/Db_autobackups') diff --git a/plugins/Db_autobackups/src/backup.cpp b/plugins/Db_autobackups/src/backup.cpp index 5854ba2287..e888ff702c 100644 --- a/plugins/Db_autobackups/src/backup.cpp +++ b/plugins/Db_autobackups/src/backup.cpp @@ -196,8 +196,8 @@ int RotateBackups(TCHAR *backupfolder, TCHAR *dbname) } while (FindNextFile(hFind, &FindFileData)); if (i > 0) - qsort(bf, (i + 1), sizeof(backupFile), Comp); //Sort the list of found files by date in descending order - for (; i >= (options.num_backups - 1); i --) { + qsort(bf, i, sizeof(backupFile), Comp); //Sort the list of found files by date in descending order + for (i --; i >= (options.num_backups - 1); i --) { mir_sntprintf(backupfolderTmp, SIZEOF(backupfolderTmp), _T("%s\\%s"), backupfolder, bf[i].Name); DeleteFile(backupfolderTmp); } -- cgit v1.2.3