From d905c446bf92adc946241732c4c2d10f9b5f483e Mon Sep 17 00:00:00 2001 From: Jared Boone Date: Fri, 13 May 2016 18:10:23 -0700 Subject: [PATCH] Fix integer width oops calculating disk space(). --- firmware/application/file.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/firmware/application/file.cpp b/firmware/application/file.cpp index 8cf840a0e..25eeda296 100644 --- a/firmware/application/file.cpp +++ b/firmware/application/file.cpp @@ -239,10 +239,11 @@ space_info space(const path& p) { #if _MAX_SS != _MIN_SS static_assert(false, "FatFs not configured for fixed sector size"); #else + const std::uintmax_t cluster_bytes = fs->csize * _MIN_SS; return { - (fs->n_fatent - 2) * fs->csize * _MIN_SS, - free_clusters * fs->csize * _MIN_SS, - free_clusters * fs->csize * _MIN_SS, + (fs->n_fatent - 2) * cluster_bytes, + free_clusters * cluster_bytes, + free_clusters * cluster_bytes, }; #endif } else {