# HG changeset patch # User jlarmour # Date 1156464761 0 # Node ID bd5fe26e87c58d698b2d31bcb2f0ae9fa36dcc9a # Parent 16ea61a1d5d4ca0c56c35724235becadf9e317a5 * src/strftime.cxx: Fixed "%I" (Time in 12 hour modus was 1 hour off) diff --git a/packages/language/c/libc/time/current/ChangeLog b/packages/language/c/libc/time/current/ChangeLog --- 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 + + * src/strftime.cxx: Fixed "%I" (Time in 12 hour modus was 1 hour off) + 2006-06-16 Andrew Lunn * tests/strptime.c: Add a testcase for the previous fix. diff --git a/packages/language/c/libc/time/current/src/strftime.cxx b/packages/language/c/libc/time/current/src/strftime.cxx --- 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)