Skip to content

Commit

Permalink
Fix a crash when selecting Default from the clock menu
Browse files Browse the repository at this point in the history
  • Loading branch information
Code7R committed Nov 7, 2024
1 parent ee4e1e9 commit 129b9aa
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/aclock.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 129b9aa

Please sign in to comment.