allow longer timezones from %Z (xav@chantry)

This commit is contained in:
rsc 2007-04-17 05:45:27 +00:00
parent adcb656c84
commit 33433b3fde

View file

@ -6,7 +6,7 @@
static int didtz; static int didtz;
static int tzdelta; static int tzdelta;
static char tzone[4]; static char tzone[32];
static void static void
dotz(void) dotz(void)
@ -48,7 +48,8 @@ tm2Tm(struct tm *tm, Tm *bigtm, int gmt)
bigtm->tzoff = 0; bigtm->tzoff = 0;
}else{ }else{
dotz(); dotz();
strcpy(bigtm->zone, tzone); strncpy(bigtm->zone, tzone, 3);
bigtm->zone[3] = 0;
bigtm->tzoff = tzdelta; bigtm->tzoff = tzdelta;
} }
} }