From 700b2c629499e62d4ac9fdf5a14b10aa355f376b Mon Sep 17 00:00:00 2001 From: Simone Guscetti Date: Fri, 18 May 2018 08:53:25 +0200 Subject: [PATCH] logger: fix overflow on SD card total bytes --- src/modules/logger/logger.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/logger/logger.cpp b/src/modules/logger/logger.cpp index af35f37851..d3d9e8fb14 100644 --- a/src/modules/logger/logger.cpp +++ b/src/modules/logger/logger.cpp @@ -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;