summaryrefslogtreecommitdiff
path: root/src/print_disk_info.c
diff options
context:
space:
mode:
authorMichael Stapelberg <michael@stapelberg.de>2009-10-16 00:25:05 +0200
committerMichael Stapelberg <michael@stapelberg.de>2009-10-16 00:25:05 +0200
commitcb9bab4255a19b201d5bb13220421e687866484d (patch)
treea0e279bad94d767ed694f14a9db18d45407aae1e /src/print_disk_info.c
parent211899480d66be3d917a9bad013de0eab95a1c79 (diff)
Bugfix: Cast the integers to uint64_t *before* multiplying (Thanks msi)
This fixes problems on 32-bit computers.
Diffstat (limited to 'src/print_disk_info.c')
-rw-r--r--src/print_disk_info.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/print_disk_info.c b/src/print_disk_info.c
index 7ad27a4..11111db 100644
--- a/src/print_disk_info.c
+++ b/src/print_disk_info.c
@@ -51,17 +51,17 @@ void print_disk_info(const char *path, const char *format) {
}
if (BEGINS_WITH(walk+1, "free")) {
- print_bytes_human(buf.f_bsize * buf.f_bfree);
+ print_bytes_human((uint64_t)buf.f_bsize * (uint64_t)buf.f_bfree);
walk += strlen("free");
}
if (BEGINS_WITH(walk+1, "used")) {
- print_bytes_human(buf.f_bsize * (buf.f_blocks - buf.f_bfree));
+ print_bytes_human((uint64_t)buf.f_bsize * ((uint64_t)buf.f_blocks - (uint64_t)buf.f_bfree));
walk += strlen("used");
}
if (BEGINS_WITH(walk+1, "total")) {
- print_bytes_human(buf.f_bsize * buf.f_blocks);
+ print_bytes_human((uint64_t)buf.f_bsize * (uint64_t)buf.f_blocks);
walk += strlen("total");
}
}