From b1287ddaf85de6feed426a750c5dc18e44faeedd Mon Sep 17 00:00:00 2001 From: cheloha Date: Tue, 22 Jan 2019 11:09:04 +0000 Subject: strptime(3): Disallow double leap second. POSIX allows for one extra second in a minute, i.e. "23:59:60", so that leap seconds can be parsed. They don't allow for *two* extra seconds, i.e. "23:59:61", though. Typo introduced in NetBSD lib/libc/time/strptime.c,v1.3. ok krw@ bcook@ tedu@ --- lib/libc/time/strptime.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/libc') diff --git a/lib/libc/time/strptime.c b/lib/libc/time/strptime.c index a1cbbdbb8e3..01330b20d4b 100644 --- a/lib/libc/time/strptime.c +++ b/lib/libc/time/strptime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: strptime.c,v 1.23 2019/01/21 21:35:58 tedu Exp $ */ +/* $OpenBSD: strptime.c,v 1.24 2019/01/22 11:09:03 cheloha Exp $ */ /* $NetBSD: strptime.c,v 1.12 1998/01/20 21:39:40 mycroft Exp $ */ /*- * Copyright (c) 1997, 1998, 2005, 2008 The NetBSD Foundation, Inc. @@ -332,7 +332,7 @@ literal: case 'S': /* The seconds. */ _LEGAL_ALT(_ALT_O); - if (!(_conv_num(&bp, &tm->tm_sec, 0, 61))) + if (!(_conv_num(&bp, &tm->tm_sec, 0, 60))) return (NULL); break; case 's': /* Seconds since epoch */ -- cgit v1.2.3