From 50b8b623cc91cb2a04cd9a4c5f8306e0db3684f9 Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Sun, 30 Jan 2005 16:10:59 +0000 Subject: [PATCH] - Folded duplicate code in "time_mktime.c"; also, errno is no longer modified unless the library is built with the "CHECK_FOR_NULL_POINTERS" option. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14821 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/changes | 16 ++++++++-------- library/time_mktime.c | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/library/changes b/library/changes index 388c683..53ecbaa 100644 --- a/library/changes +++ b/library/changes @@ -1,17 +1,17 @@ -- Folded duplicate code stdio_init_exit.c into a common function. +- Folded duplicate code in "stdio_init_exit.c" into a common function. -- Simplified the code in time_asctime_r.c which builds the time +- Simplified the code in "time_asctime_r.c" which builds the time string. It gracefully handles buffer sizes which are too short by returning an empty string. -- Moved the tm->tm_wday initialization out of the hook function - in time_strftime.c since it was to be called only once anyway. +- Moved the "tm->tm_wday" initialization out of the hook function + in "time_strftime.c" since it was to be called only once anyway. -- Lost a few compiler warnings in unistd_time_delay.c and - time_gettimeofday.c. +- Lost a few compiler warnings in "unistd_time_delay.c" and + "time_gettimeofday.c". -- Folded duplicate code in time_mktime.c; also, errno is no longer - modified unless the library is built with the CHECK_FOR_NULL_POINTERS +- Folded duplicate code in "time_mktime.c"; also, errno is no longer + modified unless the library is built with the "CHECK_FOR_NULL_POINTERS" option. diff --git a/library/time_mktime.c b/library/time_mktime.c index 5176a39..973b53f 100644 --- a/library/time_mktime.c +++ b/library/time_mktime.c @@ -1,5 +1,5 @@ /* - * $Id: time_mktime.c,v 1.5 2005-01-30 09:37:59 obarthel Exp $ + * $Id: time_mktime.c,v 1.6 2005-01-30 16:10:59 obarthel Exp $ * * :ts=4 * @@ -132,7 +132,7 @@ mktime(struct tm *tm) } /* The day of the month must be valid. */ - if(tm->tm_mday > max_month_days) + if(tm->tm_mday < 0 || tm->tm_mday > max_month_days) { SHOWVALUE(tm->tm_mday); SHOWMSG("invalid day of month");