about summary refs log tree commit diff
path: root/time/getdate.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-09-16 22:50:20 +0000
committerUlrich Drepper <drepper@redhat.com>1999-09-16 22:50:20 +0000
commita40ef91fb51b8b7ed41d8dd1f1829788c11c64b0 (patch)
tree6f04d89f3c30c0079e82dcfbab4b62a5f319590c /time/getdate.c
parent6fba2b2b55f181f4b190ee575c9ddc9226a9b902 (diff)
downloadglibc-a40ef91fb51b8b7ed41d8dd1f1829788c11c64b0.tar.gz
glibc-a40ef91fb51b8b7ed41d8dd1f1829788c11c64b0.tar.xz
glibc-a40ef91fb51b8b7ed41d8dd1f1829788c11c64b0.zip
Update.
1999-09-16  Ulrich Drepper  <drepper@cygnus.com>

	* time/getdate.c (__getdate_r): Pass correct year to check_mday.
	Reported by Vern Staats <staatsvr@asc.hpc.mil>.
Diffstat (limited to 'time/getdate.c')
-rw-r--r--time/getdate.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/time/getdate.c b/time/getdate.c
index 9957411fd8..01bd2db0ea 100644
--- a/time/getdate.c
+++ b/time/getdate.c
@@ -25,6 +25,8 @@
 #include <time.h>
 #include <sys/stat.h>
 
+#define TM_YEAR_BASE 1900
+
 
 /* Prototypes for local functions.  */
 static int first_wday (int year, int mon, int wday);
@@ -225,7 +227,8 @@ __getdate_r (const char *string, struct tm *tp)
   /* Check if the day of month is within range, and if the time can be
      represented in a time_t.  We make use of the fact that the mktime
      call normalizes the struct tm.  */
-  if ((!mday_ok && !check_mday (tp->tm_year, tp->tm_mon, tp->tm_mday))
+  if ((!mday_ok && !check_mday (TM_YEAR_BASE + tp->tm_year, tp->tm_mon,
+				tp->tm_mday))
       || mktime (tp) == (time_t) -1)
     return 8;