summaryrefslogtreecommitdiff
path: root/time/offtime.c
diff options
context:
space:
mode:
Diffstat (limited to 'time/offtime.c')
-rw-r--r--time/offtime.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/time/offtime.c b/time/offtime.c
index e588c4c66b..4b8ddb170b 100644
--- a/time/offtime.c
+++ b/time/offtime.c
@@ -21,7 +21,7 @@ Cambridge, MA 02139, USA. */
/* Defined in mktime.c. */
-extern CONST unsigned short int __mon_lengths[2][12];
+extern CONST unsigned short int __mon_yday[2][13];
#define SECS_PER_HOUR (60 * 60)
#define SECS_PER_DAY (SECS_PER_HOUR * 24)
@@ -71,10 +71,10 @@ DEFUN(__offtime, (t, offset, tp),
}
tp->tm_year = y - 1900;
tp->tm_yday = days;
- ip = __mon_lengths[__isleap(y)];
- for (y = 0; days >= ip[y]; ++y)
- days -= ip[y];
+ ip = __mon_yday[__isleap(y)];
+ for (y = 11; days < ip[y]; --y)
+ continue;
+ days -= ip[y];
tp->tm_mon = y;
tp->tm_mday = days + 1;
- tp->tm_isdst = -1;
}