changeset 2275:bd5fe26e87c5

* src/strftime.cxx: Fixed "%I" (Time in 12 hour modus was 1 hour off)
author jlarmour
date Fri, 25 Aug 2006 00:12:41 +0000
parents 16ea61a1d5d4
children e50b5a71705a
files packages/language/c/libc/time/current/ChangeLog packages/language/c/libc/time/current/src/strftime.cxx
diffstat 2 files changed, 6 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/packages/language/c/libc/time/current/ChangeLog
+++ b/packages/language/c/libc/time/current/ChangeLog
@@ -1,3 +1,7 @@
+2006-08-24  Alexander Neundorf <alexander.neundorf@jenoptik.com>
+
+	* src/strftime.cxx: Fixed "%I" (Time in 12 hour modus was 1 hour off)
+
 2006-06-16  Andrew Lunn  <andrew.lunn@ascom.ch>
 
 	* tests/strptime.c: Add a testcase for the previous fix.
--- a/packages/language/c/libc/time/current/src/strftime.cxx
+++ b/packages/language/c/libc/time/current/src/strftime.cxx
@@ -148,8 +148,8 @@ do_format(cyg_uint8 fmtchar, cyg_ucount3
     case 'I':
         if (sizeleft < 2)
             return -1;
-        buf[0] = ((timeptr->tm_hour%12 + 1) / 10) + '0';
-        buf[1] = ((timeptr->tm_hour%12 + 1) % 10) + '0';
+        buf[0] = (((timeptr->tm_hour%12) ? (timeptr->tm_hour%12) : 12) / 10) + '0';
+        buf[1] = (((timeptr->tm_hour%12) ? (timeptr->tm_hour%12) : 12) % 10) + '0';
         return 2;
     case 'j':
         if (sizeleft < 3)