From 129b9aadc2c30f5d1c30fe0887316fabadac23f0 Mon Sep 17 00:00:00 2001 From: Eduard Bloch Date: Thu, 7 Nov 2024 23:10:12 +0100 Subject: [PATCH] Fix a crash when selecting Default from the clock menu --- src/aclock.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/aclock.cc b/src/aclock.cc index 56211dffa..5f67d3e01 100644 --- a/src/aclock.cc +++ b/src/aclock.cc @@ -23,8 +23,12 @@ static const char AppletClockTimeFmt[] = "%T"; const char* YClock::strTimeFmt(const struct tm& t) { if (fTimeFormat && isEmpty(fAltFormat)) return fTimeFormat; - if (ledPixColon == null || ! prettyClock || strcmp(fmtTime, "%X")) - return (fAltFormat && (t.tm_sec & 1) ? fAltFormat : fTimeFormat); + if (ledPixColon == null || ! prettyClock || strcmp(fmtTime, "%X")) { + if (fAltFormat && (t.tm_sec & 1)) + return fAltFormat; + if (fTimeFormat) + return fTimeFormat; + } return AppletClockTimeFmt; }