aboutsummaryrefslogtreecommitdiff
path: root/src/lib9/ctime.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib9/ctime.c')
-rw-r--r--src/lib9/ctime.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/lib9/ctime.c b/src/lib9/ctime.c
index e9d971bf..0782d099 100644
--- a/src/lib9/ctime.c
+++ b/src/lib9/ctime.c
@@ -15,6 +15,7 @@ ct_numb(char *cp, int n)
char*
asctime(Tm *t)
{
+ int i;
char *ncp;
static char cbuf[30];
@@ -32,6 +33,12 @@ asctime(Tm *t)
ct_numb(cbuf+14, t->min+100);
ct_numb(cbuf+17, t->sec+100);
ncp = t->zone;
+ for(i=0; i<3; i++)
+ if(ncp[i] == 0)
+ break;
+ for(; i<3; i++)
+ ncp[i] = '?';
+ ncp = t->zone;
cbuf[20] = *ncp++;
cbuf[21] = *ncp++;
cbuf[22] = *ncp;