about summary refs log tree commit diff
path: root/Src/Modules/datetime.c
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2010-02-26 15:30:37 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2010-02-26 15:30:37 +0000
commitd5a0f7623c2b1a5c83a9602cb2f881317d2771e2 (patch)
tree7486f70f0bbb7a45fba81d95e8d81548ac1b729b /Src/Modules/datetime.c
parente8c1e2ff4ca3db7f03413958fd56b5d0783714c7 (diff)
downloadzsh-d5a0f7623c2b1a5c83a9602cb2f881317d2771e2.tar.gz
zsh-d5a0f7623c2b1a5c83a9602cb2f881317d2771e2.tar.xz
zsh-d5a0f7623c2b1a5c83a9602cb2f881317d2771e2.zip
users/14900: ULONG_MAX is a valid return value from strotoul()
Diffstat (limited to 'Src/Modules/datetime.c')
-rw-r--r--Src/Modules/datetime.c3
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') {