]> gitweb.hhaalo.de Git - feierabend.git/commitdiff
change check hour of null
authorBastian Dehn <hhaalo@arcor.de>
Mon, 23 Feb 2026 18:17:09 +0000 (19:17 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Mon, 23 Feb 2026 18:17:09 +0000 (19:17 +0100)
src/feierabend.c

index 98801352c0f15caec34caf6cfe6edeef5c0b7a51..b77aef0ec50f9f3a8ac09104f4728b0a73d57e12 100644 (file)
@@ -98,12 +98,11 @@ time_t _init_time_with_args(const char* hour, const char* min)
        const time_t now = time(NULL);
        struct tm now_tm =  _get_tm_from_time(now);
 
-       if (hour != NULL)
-               now_tm.tm_hour = atoi(hour);
-
-       if (min != NULL)
-               now_tm.tm_min = atoi(min);
+       if (hour == NULL)
+               return mktime(&now_tm);
 
+       now_tm.tm_hour = atoi(hour);
+       now_tm.tm_min = atoi(min);
        return mktime(&now_tm);
 }