]> git.notmuchmail.org Git - notmuch/blobdiff - parse-time-string/parse-time-string.c
parse-time-string: fix setting and rounding of seconds
[notmuch] / parse-time-string / parse-time-string.c
index ccad422b3c8db96462257d3df30660c63f0ee2bb..1cef47d4b0bd85faafe8fdd1cff5ad368d56459c 100644 (file)
@@ -1081,10 +1081,10 @@ parse_time (struct state *state, char sep,
        return set_user_tz (state, state->delim, v1, v2);
     }
 
-    if (!is_valid_time (v1, v2, v3))
+    if (!is_valid_time (v1, v2, n3 ? v3 : 0))
        return -PARSE_TIME_ERR_INVALIDTIME;
 
-    return set_abs_time (state, v1, v2, n3 ? v3 : 0);
+    return set_abs_time (state, v1, v2, n3 ? (int) v3 : UNSET);
 }
 
 /* strtoul helper that assigns length. */