git: 9front

Download patch

ref: 399381090ea2afd020c0fa961cca686fc6d4fd7f
parent: 53b574197884cf8c7a92fa451750add1a9fea333
author: google <google@daverabbitz.ath.cx>
date: Sun Sep 2 18:59:31 EDT 2012

Fix date formatting in asctime after year 2099.

--- a/sys/src/libc/9sys/ctime.c
+++ b/sys/src/libc/9sys/ctime.c
@@ -180,10 +180,7 @@
 	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;
 }
--