diff --git a/src/util/gui/menu.c b/src/util/gui/menu.c index 3121da829..d23433101 100644 --- a/src/util/gui/menu.c +++ b/src/util/gui/menu.c @@ -223,7 +223,8 @@ void GUIDrawBattery(struct GUIParams* params) { void GUIDrawClock(struct GUIParams* params) { char buffer[32]; time_t t = time(0); - struct tm* tm = localtime(&t); - strftime(buffer, sizeof(buffer), "%H:%M:%S", tm); + struct tm tm; + localtime_r(&t, &tm); + strftime(buffer, sizeof(buffer), "%H:%M:%S", &tm); GUIFontPrint(params->font, params->width / 2, GUIFontHeight(params->font), GUI_TEXT_CENTER, 0xFFFFFFFF, buffer); }