Error handling on system boot #30

Open
localhorst wants to merge 21 commits from feature/error-handling into main
Showing only changes of commit df3825df3a - Show all commits
+4 -4
View File
@@ -295,13 +295,13 @@ eControlState getControlState(void)
eControlWeekday getControlCurrentWeekday(void) eControlWeekday getControlCurrentWeekday(void)
{ {
// Get current time
time_t now; time_t now;
struct tm *timeinfo; struct tm timeinfo;
time(&now); time(&now);
timeinfo = localtime(&now); localtime_r(&now, &timeinfo);
int day = timeinfo->tm_wday; int day = timeinfo.tm_wday;
return (eControlWeekday)((day == 0) ? 6 : day - 1); return (eControlWeekday)((day == 0) ? 6 : day - 1);
} }