| tallow longer timezones from %Z (xav@chantry) - plan9port - [fork] Plan 9 from … | |
| git clone git://src.adamsgaard.dk/plan9port | |
| Log | |
| Files | |
| Refs | |
| README | |
| LICENSE | |
| --- | |
| commit 33433b3fde56d9b3ac6de6ee2584416b82bc856f | |
| parent adcb656c84b8a311eeebe31d9cc530c1ed822e5b | |
| Author: rsc <devnull@localhost> | |
| Date: Tue, 17 Apr 2007 05:45:27 +0000 | |
| allow longer timezones from %Z (xav@chantry) | |
| Diffstat: | |
| M src/lib9/date.c | 5 +++-- | |
| 1 file changed, 3 insertions(+), 2 deletions(-) | |
| --- | |
| diff --git a/src/lib9/date.c b/src/lib9/date.c | |
| t@@ -6,7 +6,7 @@ | |
| static int didtz; | |
| static int tzdelta; | |
| -static char tzone[4]; | |
| +static char tzone[32]; | |
| static void | |
| dotz(void) | |
| t@@ -48,7 +48,8 @@ tm2Tm(struct tm *tm, Tm *bigtm, int gmt) | |
| bigtm->tzoff = 0; | |
| }else{ | |
| dotz(); | |
| - strcpy(bigtm->zone, tzone); | |
| + strncpy(bigtm->zone, tzone, 3); | |
| + bigtm->zone[3] = 0; | |
| bigtm->tzoff = tzdelta; | |
| } | |
| } |