summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRozhuk Ivan <rozhuk.im@gmail.com>2014-12-08 18:05:22 +0000
committerRozhuk Ivan <rozhuk.im@gmail.com>2014-12-08 18:05:22 +0000
commitf43e875851959070502a73d8313ca1586e0e54d1 (patch)
tree6481696d48aba2f8f5d61ccfd0738466de3ce844
parent1b9d8c49650617f71a94744960a08f05ae64e0fe (diff)
Db_autobackups: crash on rotate fix
git-svn-id: http://svn.miranda-ng.org/main/trunk@11278 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--plugins/Db_autobackups/src/backup.cpp4
1 files changed, 2 insertions, 2 deletions
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);
}