Subject: Re: Invalid timezone (tzalloc failure) treated as out-of-memory

From: Valery Ushakov <[email-masked]>
Date: Mon, 19 Mar 2018 23:24:25 +0300

On Thu, Mar 15, 2018 at 09:43:20 -0700, Paul Eggert wrote:

> On 03/12/2018 12:10 PM, Valery Ushakov wrote:
> > -  else if (EQ (zone, Qt))
> > +  else if (EQ (zone, Qt)
> > +	   || (INTEGERP (zone) && XINT (zone) == 0))
> 
> Thanks for diagnosing the problem. If I understand things correctly, we can
> do a more-general fix, which should work for any used-in-practice time zone
> that is an integer hour offset from UTC. I installed the attached patch into
> master; please give it a try. I don't have easy access to NetBSD and would
> appreciate your testing it on NetBSD 6 and 7.

I've tested it and this patch also needs to #include <sys/param.h>
where __NetBSD_Version__ is defined.

PS: As an aside, that %+ made me realize that tzbuf_format can
probably drop that artisanal &"-"[...] and its corresponding %s, and
just pass -hour instead.

-uwe