From: antirez Date: Fri, 10 Jun 2011 12:47:12 +0000 (+0200) Subject: Fixed bug in AOF rewrite not working because of integer overflow X-Git-Url: https://git.saurik.com/redis.git/commitdiff_plain/4f948300bc26abb0aaa99343bc9f089ea98a9abe Fixed bug in AOF rewrite not working because of integer overflow --- diff --git a/src/redis.c b/src/redis.c index 26317225..dbc800fd 100644 --- a/src/redis.c +++ b/src/redis.c @@ -697,9 +697,9 @@ int serverCron(struct aeEventLoop *eventLoop, long long id, void *clientData) { { int base = server.auto_aofrewrite_base_size ? server.auto_aofrewrite_base_size : 1; - int growth = (server.appendonly_current_size*100/base); + long long growth = (server.appendonly_current_size*100/base); if (growth >= server.auto_aofrewrite_perc) { - redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %d growth",growth); + redisLog(REDIS_NOTICE,"Starting automatic rewriting of AOF on %lld growth",growth); rewriteAppendOnlyFileBackground(); } }