From: Bastian Dehn Date: Mon, 23 Feb 2026 18:17:09 +0000 (+0100) Subject: change check hour of null X-Git-Tag: 1.3.18^2~4 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=0b5b46d5fb6343785532623f5c0d82739196ecd8;p=feierabend.git change check hour of null --- diff --git a/src/feierabend.c b/src/feierabend.c index 9880135..b77aef0 100644 --- a/src/feierabend.c +++ b/src/feierabend.c @@ -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); }