From 075de3c919a73245ccbc7f8edec769a6e44074a6 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 4 Nov 2015 15:00:15 +0100 Subject: [PATCH] math is hard, typing is harder. bugfix. thank you, valgrind my friend. --- src/util/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/log.c b/src/util/log.c index 9f5f0abb2..29b0e1151 100644 --- a/src/util/log.c +++ b/src/util/log.c @@ -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) {