From d0a80c79607d6953f5c1b4816fba468f2b960de7 Mon Sep 17 00:00:00 2001 From: Pierre HUBERT Date: Mon, 23 Sep 2024 21:49:45 +0200 Subject: [PATCH] Prevent potential value overflow --- central_backend/src/energy/consumption_history_file.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/central_backend/src/energy/consumption_history_file.rs b/central_backend/src/energy/consumption_history_file.rs index 5b9a43d..0ffa290 100644 --- a/central_backend/src/energy/consumption_history_file.rs +++ b/central_backend/src/energy/consumption_history_file.rs @@ -45,7 +45,7 @@ impl ConsumptionHistoryFile { fn new_memory(day: u64) -> Self { Self { day, - buff: vec![0; 3600 * 24 / TIME_INTERVAL], + buff: vec![0; (3600 * 24 / TIME_INTERVAL) + 1], } }