Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libc/time If the TZ environment variable was set to the ...



details:   https://anonhg.NetBSD.org/src/rev/125ca05ef00a
branches:  trunk
changeset: 509143:125ca05ef00a
user:      atatat <atatat%NetBSD.org@localhost>
date:      Fri Apr 27 14:21:15 2001 +0000

description:
If the TZ environment variable was set to the empty string, a call to
ctime() would get a bus error (or a segmentation fault).  Setting these
variables eliminates that problem.

Fixes pr lib/12750.

diffstat:

 lib/libc/time/localtime.c |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (27 lines):

diff -r dc1a4e954b10 -r 125ca05ef00a lib/libc/time/localtime.c
--- a/lib/libc/time/localtime.c Fri Apr 27 12:55:51 2001 +0000
+++ b/lib/libc/time/localtime.c Fri Apr 27 14:21:15 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: localtime.c,v 1.26 2001/03/31 18:45:38 kleink Exp $    */
+/*     $NetBSD: localtime.c,v 1.27 2001/04/27 14:21:15 atatat Exp $    */
 
 /*
 ** This file is in the public domain, so clarified as of
@@ -10,7 +10,7 @@
 #if 0
 static char    elsieid[] = "@(#)localtime.c    7.70";
 #else
-__RCSID("$NetBSD: localtime.c,v 1.26 2001/03/31 18:45:38 kleink Exp $");
+__RCSID("$NetBSD: localtime.c,v 1.27 2001/04/27 14:21:15 atatat Exp $");
 #endif
 #endif /* LIBC_SCCS and not lint */
 
@@ -1040,6 +1040,8 @@
                */
                lclptr->leapcnt = 0;            /* so, we're off a little */
                lclptr->timecnt = 0;
+               lclptr->typecnt = 0;
+               lclptr->ttis[0].tt_isdst = 0;
                lclptr->ttis[0].tt_gmtoff = 0;
                lclptr->ttis[0].tt_abbrind = 0;
                (void)strncpy(lclptr->chars, gmt, sizeof(lclptr->chars) - 1);



Home | Main Index | Thread Index | Old Index