mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-11-29 20:20:56 +08:00
logger: fix overflow on SD card total bytes
This commit is contained in:
1 parent
c7cb62eb28
commit
700b2c6294
1 file changed
+1
-1
@@ -2117,7 +2117,7 @@ int Logger::check_free_space()
|
||||
|
||||
|
||||
uint64_t min_free_bytes = 300ULL * 1024ULL * 1024ULL;
|
||||
uint64_t total_bytes = statfs_buf.f_blocks * statfs_buf.f_bsize;
|
||||
uint64_t total_bytes = (uint64_t)statfs_buf.f_blocks * statfs_buf.f_bsize;
|
||||
|
||||
if (total_bytes / 10 < min_free_bytes) { // reduce the minimum if it's larger than 10% of the disk size
|
||||
min_free_bytes = total_bytes / 10;
|
||||
|
||||
Reference in new issue
Block a user