diff options
Diffstat (limited to 'Src/Modules')
-rw-r--r-- | Src/Modules/datetime.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/Src/Modules/datetime.c b/Src/Modules/datetime.c index f1c5488ea..2f69ecae6 100644 --- a/Src/Modules/datetime.c +++ b/Src/Modules/datetime.c @@ -111,8 +111,9 @@ bin_strftime(char *nam, char **argv, Options ops, UNUSED(int func)) if (OPT_ISSET(ops, 'r')) return reverse_strftime(nam, argv, scalar, OPT_ISSET(ops, 'q')); + errno = 0; secs = (time_t)strtoul(argv[1], &endptr, 10); - if (secs == (time_t)ULONG_MAX) { + if (secs == (time_t)ULONG_MAX && errno != 0) { zwarnnam(nam, "%s: %e", argv[1], errno); return 1; } else if (*endptr != '\0') { |