From 0b5b46d5fb6343785532623f5c0d82739196ecd8 Mon Sep 17 00:00:00 2001 From: Bastian Dehn Date: Mon, 23 Feb 2026 19:17:09 +0100 Subject: [PATCH] change check hour of null --- src/feierabend.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) 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); } -- 2.47.3