summaryrefslogtreecommitdiff
path: root/components/libc
diff options
context:
space:
mode:
author[email protected] <[email protected]>2010-07-29 21:02:50 +0000
committer[email protected] <[email protected]>2010-07-29 21:02:50 +0000
commitb9fcbfc34489856a06554c0a3c453ad60e20cecd (patch)
treea7a3d8083bbef462bbeb8bab9b35693e87490a93 /components/libc
parent56916d1a73fa8e98cfc40d5c683b41b3d4f1a812 (diff)
fix timegm function issue.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@817 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/libc')
-rw-r--r--components/libc/minilibc/time.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/components/libc/minilibc/time.c b/components/libc/minilibc/time.c
index 4c39c3c25d..a00e54580e 100644
--- a/components/libc/minilibc/time.c
+++ b/components/libc/minilibc/time.c
@@ -80,11 +80,10 @@ time_t timegm(struct tm *const t) {
if (t->tm_sec>60) { t->tm_min += t->tm_sec/60; t->tm_sec%=60; }
if (t->tm_min>60) { t->tm_hour += t->tm_min/60; t->tm_min%=60; }
- if (t->tm_hour>60) { t->tm_mday += t->tm_hour/60; t->tm_hour%=60; }
+ if (t->tm_hour>24) { t->tm_mday += t->tm_hour/24; t->tm_hour%=24; }
if (t->tm_mon>12) { t->tm_year += t->tm_mon/12; t->tm_mon%=12; }
while (t->tm_mday>__spm[1+t->tm_mon]) {
if (t->tm_mon==1 && __isleap(t->tm_year+1900)) {
- if (t->tm_mon==31+29) break;
--t->tm_mday;
}
t->tm_mday-=__spm[t->tm_mon];