From 953da20e25f151d042e6e45b2dce3cc40aac0170 Mon Sep 17 00:00:00 2001 From: Logan Chien Date: Wed, 1 Jan 2014 12:27:40 +0800 Subject: [PATCH] Fix initialization bug in localtime. Problem reported by Logan Chien in . * localtime.c (tzparse): Initialize sp->defaulttype to 0. --- localtime.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/localtime.c b/localtime.c index dcfc1cd..5ee2f3b 100644 --- a/localtime.c +++ b/localtime.c @@ -1013,6 +1013,7 @@ tzparse(const char *name, register struct state *const sp, sp->ttis[1].tt_gmtoff = -stdoffset; sp->ttis[1].tt_isdst = 0; sp->ttis[1].tt_abbrind = 0; + sp->defaulttype = 0; timecnt = 0; janfirst = 0; yearlim = EPOCH_YEAR + YEARSPERREPEAT; @@ -1138,6 +1139,7 @@ tzparse(const char *name, register struct state *const sp, sp->ttis[1].tt_isdst = TRUE; sp->ttis[1].tt_abbrind = stdlen + 1; sp->typecnt = 2; + sp->defaulttype = 0; } } else { dstlen = 0; @@ -1147,6 +1149,7 @@ tzparse(const char *name, register struct state *const sp, sp->ttis[0].tt_gmtoff = -stdoffset; sp->ttis[0].tt_isdst = 0; sp->ttis[0].tt_abbrind = 0; + sp->defaulttype = 0; } sp->charcnt = stdlen + 1; if (dstlen != 0)