From a19d60f5241a67d57a9e6dec2eab70fd5d2b0c0d Mon Sep 17 00:00:00 2001 From: Olaf Barthel Date: Thu, 19 May 2005 13:57:53 +0000 Subject: [PATCH] - For %C strtime() should return the century number, not the year number mod 100. git-svn-id: file:///Users/olsen/Code/migration-svn-zu-git/logical-line-staging/clib2/trunk@14955 87f5fb63-7c3d-0410-a384-fd976d0f7a62 --- library/changes | 3 +++ library/include/math.h | 4 ++-- library/time_strftime.c | 6 +++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/library/changes b/library/changes index 0528db6..3d02e0a 100644 --- a/library/changes +++ b/library/changes @@ -22,6 +22,9 @@ __translate_amiga_to_unix_path_name() to not to call strlen() on the results of __strip_double_slash(). +- For %C strtime() should return the century number, not the + year number mod 100. + c.lib 1.192 (12.5.2005) diff --git a/library/include/math.h b/library/include/math.h index 2542e8d..89225ef 100644 --- a/library/include/math.h +++ b/library/include/math.h @@ -1,5 +1,5 @@ /* - * $Id: math.h,v 1.9 2005-05-12 13:21:47 obarthel Exp $ + * $Id: math.h,v 1.10 2005-05-19 13:57:53 obarthel Exp $ * * :ts=4 * @@ -210,7 +210,7 @@ extern int __isunordered_double(double x,double y); (isunordered(x,y) ? 0 : (x) <= (y)) #define islessgreater(x,y) \ - (isunordered(x,y) ? 0 : (x) < (y) || (x) > (y)) /* ZZZ don't evaulate twice! */ + (isunordered(x,y) ? 0 : (x) < (y) || (x) > (y)) /* ZZZ don't evaluate twice! */ /****************************************************************************/ diff --git a/library/time_strftime.c b/library/time_strftime.c index 8f85140..92d44b8 100644 --- a/library/time_strftime.c +++ b/library/time_strftime.c @@ -1,5 +1,5 @@ /* - * $Id: time_strftime.c,v 1.15 2005-05-14 14:47:46 obarthel Exp $ + * $Id: time_strftime.c,v 1.16 2005-05-19 13:57:52 obarthel Exp $ * * :ts=4 * @@ -239,10 +239,10 @@ format_date(const char *format,const struct tm *tm,struct Hook * hook) format_date("%a %b %d %H:%M:%S %Y",tm,hook); break; - /* The last two digits of a year ("00"; C99). */ + /* The century number ("00"-"99"; C99). */ case 'C': - __number_to_string((unsigned int)(tm->tm_year % 100),buffer,sizeof(buffer),2); + __number_to_string((unsigned int)(tm->tm_year / 100),buffer,sizeof(buffer),2); store_string_via_hook(buffer,2,hook); break;