This is the mail archive of the
libc-alpha@sourceware.cygnus.com
mailing list for the glibc project.
[ane@np.bs1.fc.nec.co.jp] libc/1617: getdate.c can't handle 28 Feb
- To: libc-alpha Mailinglist <libc-alpha at sourceware dot cygnus dot com>
- Subject: [ane@np.bs1.fc.nec.co.jp] libc/1617: getdate.c can't handle 28 Feb
- From: Andreas Jaeger <aj at suse dot de>
- Date: 01 Mar 2000 10:29:35 +0100
- Cc: ane at np dot bs1 dot fc dot nec dot co dot jp
Hi glibc folks,
here's a bug report. I'm appending a clean patch and ChangeLog
entry. Please apply this for glibc 2.1 and 2.2. I'm currently
developing a small test program for getdate which I'll send later.
Andreas
2000-03-01 Andreas Jaeger <aj@suse.de>
* time/getdate.c (check_mday): Fix check for february.
Reported by ane@np.bs1.fc.nec.co.jp, closes PR libc/1617.
--- time/getdate.c.~1~ Fri Sep 17 08:51:57 1999
+++ time/getdate.c Wed Mar 1 10:28:20 2000
@@ -1,5 +1,5 @@
/* Convert a string representation of time to a time value.
- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc.
+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc.
This file is part of the GNU C Library.
Contributed by Mark Kettenis <kettenis@phys.uva.nl>, 1997.
@@ -91,7 +91,7 @@
return 1;
break;
case 1:
- if (mday >= 1 && mday < (__isleap (year) ? 29 : 28))
+ if (mday >= 1 && mday <= (__isleap (year) ? 29 : 28))
return 1;
break;
}
- Subject: libc/1617: getdate.c can't handle 28 Feb
- From: ane at np dot bs1 dot fc dot nec dot co dot jp
- Date: Wed Mar 1 10:26:00 2000
Topics:
libc/1617: getdate.c can't handle 28 Feb( 29 Feb : leap )
----------------------------------------------------------------------
Date: Wed, 1 Mar 2000 03:33:07 -0500
From: ane@np.bs1.fc.nec.co.jp
To: bugs@gnu.org
Subject: libc/1617: getdate.c can't handle 28 Feb( 29 Feb : leap )
Message-Id: <200003010833.DAA09112@delysid.gnu.org>
>Number: 1617
>Category: libc
>Synopsis: getdate.c can't handle 28 Feb( 29 Feb : leap )
>Confidential: no
>Severity: critical
>Priority: medium
>Responsible: libc-gnats
>State: open
>Class: sw-bug
>Submitter-Id: unknown
>Arrival-Date: Wed Mar 01 03:40:01 EST 2000
>Last-Modified:
>Originator: ane@np.bs1.fc.nec.co.jp
>Organization:
net
>Release: 2.1.2
>Environment:
everything
>Description:
getdate.c
line:94
NG : if (mday >= 1 && mday < (__isleap (year) ? 29 : 28))
OK : if (mday >= 1 && mday <= (__isleap (year) ? 29 : 28))
^
>How-To-Repeat:
getdate causes error code 8 for these parameters
"Sun Feb 28 21:01:10 1999"
"Tue Feb 29 16:30:46 2000%2
>Fix:
>Audit-Trail:
>Unformatted:
------------------------------
End of forwardnJA_0Z Digest
***************************
--
Andreas Jaeger
SuSE Labs aj@suse.de
private aj@arthur.rhein-neckar.de