]> sourceware.org Git - newlib-cygwin.git/commitdiff
* libc/time/strptime.c (first_day): Actually return the wday
authorCorinna Vinschen <corinna@vinschen.de>
Thu, 12 May 2011 12:43:43 +0000 (12:43 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Thu, 12 May 2011 12:43:43 +0000 (12:43 +0000)
of the first day of the year.

newlib/ChangeLog
newlib/libc/time/strptime.c

index b6d83872aef4b44c66862f072ec45c303bc7dcc6..fe8bd88cad6bf05c2ab887bc002e1e24759c0234 100644 (file)
@@ -1,3 +1,8 @@
+2011-05-12  Peter Rosin  <peda@lysator.liu.se>
+
+       * libc/time/strptime.c (first_day): Actually return the wday
+       of the first day of the year.
+
 2011-05-10  Corinna Vinschen  <vinschen@redhat.com>
 
        * libc/locale/lmessages.c (_C_messages_locale): Add missing comma.
index 1457c93edd809f40667806a3b09e43661134b3d0..bc16fa5ebae4eca655d09926353ce796df72f696 100644 (file)
@@ -78,8 +78,8 @@ first_day (int year)
 {
     int ret = 4;
 
-    for (; year > 1970; --year)
-       ret = (ret + 365 + is_leap_year (year) ? 1 : 0) % 7;
+    while (--year >= 1970)
+       ret = (ret + 365 + is_leap_year (year)) % 7;
     return ret;
 }
 
This page took 0.054648 seconds and 5 git commands to generate.