From bf9d8dafb6cbce9d7e2bd2c4857b565246cc46e7 Mon Sep 17 00:00:00 2001 From: Robin Dietzel Date: Fri, 3 Feb 2023 12:19:45 +0100 Subject: [PATCH] HOTFIX: removed horrible bug with buffer overrung *sigh* --- floatpump/Core/Src/main.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/floatpump/Core/Src/main.cpp b/floatpump/Core/Src/main.cpp index 34df88e..8db61a0 100644 --- a/floatpump/Core/Src/main.cpp +++ b/floatpump/Core/Src/main.cpp @@ -231,7 +231,8 @@ int main(void) { { dly_disp = HAL_GetTick(); display.LCDSetBacklight(S_backlight); - char buf[20]; + //Increase to 21 -> crucial bug! usually never use sprintf! TODO: find another option instead!!!! + char buf[21]; display.LCDSetCursor(0, 0); sprintf(buf, "Fuellstand %3d %%", tankLevel0.getPercent());