From e337c009fca2f7418ca5d7938c396ff1e50e4e79 Mon Sep 17 00:00:00 2001 From: ginsbach Date: Mon, 21 Sep 2020 15:31:54 +0000 Subject: 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. --- lib/libc/time/strptime.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') 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 #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. */ -- cgit