Avoid overflowing counter when converting obsolete max size

This commit is contained in:
Joel Rosdahl 2012-07-03 11:52:37 +02:00
parent 1285bfd33a
commit d24b26cb1c

View File

@ -373,7 +373,7 @@ stats_get_obsolete_limits(const char *dir, unsigned *maxfiles, uint64_t *maxsize
char *sname = format("%s/stats", dir);
stats_read(sname, counters);
*maxfiles = counters->data[STATS_OBSOLETE_MAXFILES];
*maxsize = counters->data[STATS_OBSOLETE_MAXSIZE] * 1024;
*maxsize = (uint64_t)counters->data[STATS_OBSOLETE_MAXSIZE] * 1024;
free(sname);
counters_free(counters);
}