[tz] defensive value for define on Solaris causes load of timerule to fail

Paul Eggert eggert at cs.ucla.edu
Tue Jun 13 05:21:47 UTC 2017


On 06/12/2017 04:25 PM, Jonathan Leffler wrote:
> I was under the impression Paul had just said that using snprintf() 
> was OK now as it was part of C99 — though he mistyped C99 as C89

Oops, I thought that snprintf was in C89. I guess if we're still 
assuming only C89 or better then that's a bug that should be fixed. 
Please see attached proposed patch (parts 3 and 4, the latter to fix a 
typo in 3).

For localtime.c, it's probably better to avoid sprintf/snprintf/etc. In 
the good old days people would avoid sprintf because it pulled in a 
bunch of floating-point code (to support %f etc.) even when not needed. 
Nowadays the major knock on sprintf/etc. is that it doesn't work if the 
result contains more than INT_MAX bytes.

That being said, strcat should be avoided there, if only to pacify picky 
compilers and human readers that worry about a buffer overrun that 
cannot really happen. I installed the attached patches 1 and 2 to try to 
make progress in that area.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Minor-TZDIR-improvements.patch
Type: text/x-patch
Size: 2284 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20170612/bcab9c03/0001-Minor-TZDIR-improvements.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-Remove-some-dependencies.patch
Type: text/x-patch
Size: 4211 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20170612/bcab9c03/0002-Remove-some-dependencies.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0003-Port-zdump.c-back-to-C89.patch
Type: text/x-patch
Size: 3374 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20170612/bcab9c03/0003-Port-zdump.c-back-to-C89.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0004-NEWS-Fix-typo.patch
Type: text/x-patch
Size: 774 bytes
Desc: not available
URL: <http://mm.icann.org/pipermail/tz/attachments/20170612/bcab9c03/0004-NEWS-Fix-typo.patch>


More information about the tz mailing list