mirror of
https://github.com/portapack-mayhem/mayhem-firmware.git
synced 2025-08-12 13:37:46 +00:00
Fix integer width oops calculating disk space().
This commit is contained in:
@@ -239,10 +239,11 @@ space_info space(const path& p) {
|
|||||||
#if _MAX_SS != _MIN_SS
|
#if _MAX_SS != _MIN_SS
|
||||||
static_assert(false, "FatFs not configured for fixed sector size");
|
static_assert(false, "FatFs not configured for fixed sector size");
|
||||||
#else
|
#else
|
||||||
|
const std::uintmax_t cluster_bytes = fs->csize * _MIN_SS;
|
||||||
return {
|
return {
|
||||||
(fs->n_fatent - 2) * fs->csize * _MIN_SS,
|
(fs->n_fatent - 2) * cluster_bytes,
|
||||||
free_clusters * fs->csize * _MIN_SS,
|
free_clusters * cluster_bytes,
|
||||||
free_clusters * fs->csize * _MIN_SS,
|
free_clusters * cluster_bytes,
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
} else {
|
} else {
|
||||||
|
Reference in New Issue
Block a user