summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorginsbach <ginsbach@NetBSD.org>2020-09-21 15:31:54 +0000
committerginsbach <ginsbach@NetBSD.org>2020-09-21 15:31:54 +0000
commite337c009fca2f7418ca5d7938c396ff1e50e4e79 (patch)
tree12a376d15f4771a2f66f79f0cc260c27f78de114
parent826372e89932cf0a652da9adf1643edf23c51a34 (diff)
Correct range for ISO week conversion
The %V conversion range for strptime(3) should match the strftime(3) conversion range. A valid ISO week is 1-53.
-rw-r--r--lib/libc/time/strptime.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c
index 54a1dff733a..57861bc3e73 100644
--- a/lib/libc/time/strptime.c
+++ b/lib/libc/time/strptime.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strptime.c,v 1.62 2017/08/24 01:01:09 ginsbach Exp $ */
+/* $NetBSD: strptime.c,v 1.63 2020/09/21 15:31:54 ginsbach Exp $ */
/*-
* Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strptime.c,v 1.62 2017/08/24 01:01:09 ginsbach Exp $");
+__RCSID("$NetBSD: strptime.c,v 1.63 2020/09/21 15:31:54 ginsbach Exp $");
#endif
#include "namespace.h"
@@ -424,7 +424,7 @@ literal:
continue;
case 'V': /* The ISO 8601:1988 week number as decimal */
- bp = conv_num(bp, &i, 0, 53);
+ bp = conv_num(bp, &i, 1, 53);
continue;
case 'Y': /* The year. */