]> git.ipfire.org Git - thirdparty/nftables.git/commitdiff
meta: parse_iso_date() returns boolean
authorPhil Sutter <phil@nwl.cc>
Wed, 11 Jan 2023 10:26:41 +0000 (11:26 +0100)
committerPhil Sutter <phil@nwl.cc>
Fri, 13 Jan 2023 16:11:18 +0000 (17:11 +0100)
Returning ts if 'ts == (time_t) -1' signals success to caller despite
failure.

Fixes: 4460b839b945a ("meta: fix compiler warning in date_type_parse()")
Signed-off-by: Phil Sutter <phil@nwl.cc>
src/meta.c

index bd8a41ba3a0327c65684790e0fc93cd2ca78a8d6..013e8cbaf38a5dbd2d4aa2ce6fad0099c1cec304 100644 (file)
@@ -433,7 +433,7 @@ success:
        cur_tm = localtime(&ts);
 
        if (ts == (time_t) -1 || cur_tm == NULL)
-               return ts;
+               return false;
 
        /* Substract tm_gmtoff to get the current time */
        *tstamp = ts - cur_tm->tm_gmtoff;