summaryrefslogtreecommitdiff
path: root/sys/src/libc
diff options
context:
space:
mode:
authorgoogle <google@daverabbitz.ath.cx>2012-09-02 22:59:31 +1200
committergoogle <google@daverabbitz.ath.cx>2012-09-02 22:59:31 +1200
commit67e047589a4257145c2507f2e7814a512434306a (patch)
treeb4e4797a984789c7bee663655d010126c46e215e /sys/src/libc
parente91301a40108d39125eacb40c42d290c028914e7 (diff)
Fix date formatting in asctime after year 2099.
Diffstat (limited to 'sys/src/libc')
-rw-r--r--sys/src/libc/9sys/ctime.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/sys/src/libc/9sys/ctime.c b/sys/src/libc/9sys/ctime.c
index d841b64e9..11340ea41 100644
--- a/sys/src/libc/9sys/ctime.c
+++ b/sys/src/libc/9sys/ctime.c
@@ -180,10 +180,7 @@ asctime(Tm *t)
cbuf[20] = *ncp++;
cbuf[21] = *ncp++;
cbuf[22] = *ncp;
- if(t->year >= 100) {
- cbuf[24] = '2';
- cbuf[25] = '0';
- }
+ ct_numb(cbuf+24, (t->year+1900) / 100 + 100);
ct_numb(cbuf+26, t->year+100);
return cbuf;
}