forked from github/server
math is hard, typing is harder. bugfix. thank you, valgrind my friend.
This commit is contained in:
parent
67e2eafbcf
commit
075de3c919
1 changed files with 1 additions and 1 deletions
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue