diff options
author | Edwin Groothuis <edwin@FreeBSD.org> | 2010-03-02 10:11:24 +0000 |
---|---|---|
committer | Edwin Groothuis <edwin@FreeBSD.org> | 2010-03-02 10:11:24 +0000 |
commit | 0a3e753dde2993b4b341e9afce1ad10557ad569e (patch) | |
tree | 2753a42de64f488d756484d06af76e179ae802c3 | |
parent | 922ba8695f9afa9d07b21a861536528d84685941 (diff) |
Import of tzcode2010c:vendor/tzcode/tzcode2010c
localtime.c - more core dump avoidance work
Notes
Notes:
svn path=/vendor/tzcode/dist/; revision=204570
svn path=/vendor/tzcode/tzcode2010c/; revision=204571; tag=vendor/tzcode/tzcode2010c
-rw-r--r-- | libc/stdtime/localtime.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libc/stdtime/localtime.c b/libc/stdtime/localtime.c index 255ff4828a52..f5833e85b790 100644 --- a/libc/stdtime/localtime.c +++ b/libc/stdtime/localtime.c @@ -5,7 +5,7 @@ #ifndef lint #ifndef NOID -static char elsieid[] = "@(#)localtime.c 8.10"; +static char elsieid[] = "@(#)localtime.c 8.13"; #endif /* !defined NOID */ #endif /* !defined lint */ @@ -350,6 +350,7 @@ register const int doextend; 4 * TZ_MAX_TIMES]; } u; + sp->goback = sp->goahead = FALSE; if (name == NULL && (name = TZDEFAULT) == NULL) return -1; { @@ -555,7 +556,6 @@ register const int doextend; sp->ttis[sp->typecnt++] = ts.ttis[1]; } } - sp->goback = sp->goahead = FALSE; if (sp->timecnt > 1) { for (i = 1; i < sp->timecnt; ++i) if (typesequiv(sp, sp->types[i], sp->types[0]) && @@ -1163,7 +1163,7 @@ tzsetwall(void) #ifdef ALL_STATE if (lclptr == NULL) { - lclptr = (struct state *) malloc(sizeof *lclptr); + lclptr = (struct state *) calloc(1, sizeof *lclptr); if (lclptr == NULL) { settzname(); /* all we can do */ return; @@ -1194,7 +1194,7 @@ tzset(void) #ifdef ALL_STATE if (lclptr == NULL) { - lclptr = (struct state *) malloc(sizeof *lclptr); + lclptr = (struct state *) calloc(1, sizeof *lclptr); if (lclptr == NULL) { settzname(); /* all we can do */ return; @@ -1355,7 +1355,7 @@ struct tm * const tmp; if (!gmt_is_set) { gmt_is_set = TRUE; #ifdef ALL_STATE - gmtptr = (struct state *) malloc(sizeof *gmtptr); + gmtptr = (struct state *) calloc(1, sizeof *gmtptr); if (gmtptr != NULL) #endif /* defined ALL_STATE */ gmtload(gmtptr); |