Ensure space calculation is performed as a uint64_t (Fixes #125)

This commit is contained in:
Jeremy Lakeman 2017-09-06 13:00:03 +09:30
parent 3333d2faa2
commit 1c543f3c41

View File

@ -185,17 +185,11 @@ static uint64_t store_get_free_space()
if (statvfs(store_path, &stats)==-1)
WARNF_perror("statvfs(%s)", store_path);
else
space = stats.f_frsize * stats.f_bavail;
space = stats.f_frsize * (uint64_t)stats.f_bavail;
}
}
#endif
if (IF_DEBUG(rhizome)) {
double pretty = space;
const char *suffix = " KMGT";
while(pretty >= 1024 && suffix[1]){
pretty = pretty / 1024;
suffix++;
}
// Automated tests depend on this message; do not alter.
DEBUGF(rhizome, "RHIZOME SPACE FREE bytes=%"PRIu64" (%sB)", space, alloca_double_scaled_binary(space));
}