summaryrefslogtreecommitdiffstats
path: root/newlib/libc/time/strptime.c
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2011-05-12 12:43:43 +0000
committerCorinna Vinschen <corinna@vinschen.de>2011-05-12 12:43:43 +0000
commit7bb76e751b1df7b8d0a7527197540a0a26071758 (patch)
tree983a08725bf6fbc04520d01dd26986ee8165c50c /newlib/libc/time/strptime.c
parent205b82080b970ff22d65b85da22eb7778d45b380 (diff)
downloadcygnal-7bb76e751b1df7b8d0a7527197540a0a26071758.tar.gz
cygnal-7bb76e751b1df7b8d0a7527197540a0a26071758.tar.bz2
cygnal-7bb76e751b1df7b8d0a7527197540a0a26071758.zip
* libc/time/strptime.c (first_day): Actually return the wday
of the first day of the year.
Diffstat (limited to 'newlib/libc/time/strptime.c')
-rw-r--r--newlib/libc/time/strptime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/newlib/libc/time/strptime.c b/newlib/libc/time/strptime.c
index 1457c93ed..bc16fa5eb 100644
--- a/newlib/libc/time/strptime.c
+++ b/newlib/libc/time/strptime.c
@@ -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;
}