math is hard, typing is harder. bugfix. thank you, valgrind my friend.

This commit is contained in:
Enno Rehling 2015-11-04 15:00:15 +01:00
parent 67e2eafbcf
commit 075de3c919
1 changed files with 1 additions and 1 deletions

View File

@ -84,7 +84,7 @@ void log_rotate(const char *filename, int maxindex)
sprintf(buffer[dst], "%s.%d", filename, maxindex);
while (maxindex > 0) {
int err, src = dst - 1;
int err, src = 1 - dst;
sprintf(buffer[src], "%s.%d", filename, --maxindex);
err = rename(buffer[src], buffer[dst]);
if (err != 0) {