diff options
author | cheloha <cheloha@cvs.openbsd.org> | 2019-01-22 11:09:04 +0000 |
---|---|---|
committer | cheloha <cheloha@cvs.openbsd.org> | 2019-01-22 11:09:04 +0000 |
commit | b1287ddaf85de6feed426a750c5dc18e44faeedd (patch) | |
tree | 3a9bfdae7699cf0c39c53c61e3cc26e7e4f84f6c /lib/libc/time | |
parent | dca8e45d5bbf3413a03ebae25357c2b3f9c4cbe6 (diff) |
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@
Diffstat (limited to 'lib/libc/time')
-rw-r--r-- | lib/libc/time/strptime.c | 4 |
1 files changed, 2 insertions, 2 deletions
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 */ |