MSOpenTech/redis — pull request #46 by sectionzero (2013-05-25 12:47:54+00:00)
Title: Fixed AOF growth calculation overflow

Fixed an overflow the AOF growth calculation that prevents the automatic rewriting of the log file when it becomes too big:

Before:
```c
long long base = server.aof_rewrite_base_size ?
server.aof_rewrite_base_size : 1;
long long growth = (server.aof_current_size*100/base) - 100;
if (growth >= server.aof_rewrite_perc) {
//rewrite append only file
}
```
*server.aof_current_size* is of type *off_t*;
assuming that *server.aof_current_size* is, for example 83886080, multiplying it for 100 will cause an overflow, the result of the entire expression will be a negative number and the AOF rewrite will be never triggered.