Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time Correct range for ISO week conversion



details:   https://anonhg.NetBSD.org/src/rev/984107d4d6de
branches:  trunk
changeset: 955143:984107d4d6de
user:      ginsbach <ginsbach%NetBSD.org@localhost>
date:      Mon Sep 21 15:31:54 2020 +0000

description:
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.

diffstat:

 lib/libc/time/strptime.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 6d890d211cf7 -r 984107d4d6de lib/libc/time/strptime.c
--- a/lib/libc/time/strptime.c  Mon Sep 21 14:03:15 2020 +0000
+++ b/lib/libc/time/strptime.c  Mon Sep 21 15:31:54 2020 +0000
@@ -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 @@
                        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. */



Home | Main Index | Thread Index | Old Index