This is the mail archive of the
newlib@sourceware.org
mailing list for the newlib project.
Re: [PATCH] strftime: use tzname if TM_ZONE is NULL
- From: Yaakov Selkowitz <yselkowi at redhat dot com>
- To: newlib at sourceware dot org
- Date: Mon, 30 Mar 2015 14:09:43 -0500
- Subject: Re: [PATCH] strftime: use tzname if TM_ZONE is NULL
- Authentication-results: sourceware.org; auth=none
- References: <1427320007-13036-1-git-send-email-yselkowi at redhat dot com>
On Wed, 2015-03-25 at 16:46 -0500, Yaakov Selkowitz wrote:
> * libc/time/strftime.c (strftime) <%Z>: Initialize tznam to NULL.
> Use _tzname as fallback if TM_ZONE is NULL.
> ---
> The crash was due to a strlen(NULL) a few lines later, which should NOT
> happen. glibc takes this a step further and calls tzset() if not yet
> called so that the returned string matches the local timezone (instead
> of "GMT", or on Cygwin, " "). The question is how to (portably)
> determine if tzset() has been called already or not (e.g. a global
> variable?).
Craig's patch would take care of this, so I'd like to repropose this
patch as is.
--
Yaakov Selkowitz
Associate Software Engineer, ARM
Red Hat, Inc.