Skip to content

Commit

Permalink
Update main.cpp
Browse files Browse the repository at this point in the history
Fix macro DAY for case is less 10 (with space instead of expected '0' character)
  • Loading branch information
bvernoux authored Aug 3, 2024
1 parent e2b510e commit 4abf00b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Software/LibreCAL/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const char* time = __TIME__;
: date[2] == 't' ? 10 \
: date[2] == 'v' ? 11 : 12)

#define DAY(date) ((date[4] - '0') * 10 + (date[5] - '0'))
#define DAY(date) ((date[4] == ' ' ? 0 : (date[4] - '0') * 10) + (date[5] - '0'))
#define HOUR(time) ((time[0] - '0') * 10 + (time[1] - '0'))
#define MINUTE(time) ((time[3] - '0') * 10 + (time[4] - '0'))
#define SECOND(time) ((time[6] - '0') * 10 + (time[7] - '0'))
Expand Down

0 comments on commit 4abf00b

Please sign in to comment.