[ane@np.bs1.fc.nec.co.jp] libc/1617: getdate.c can't handle 28 Feb

Andreas Jaeger aj@suse.de
Wed Mar 1 01:32:00 GMT 2000


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;
     }



More information about the Libc-alpha mailing list