[tz] localtime.c patch

Christos Zoulas christos at zoulas.com
Wed Oct 8 15:02:35 UTC 2014

On Oct 7, 10:11pm, eggert at cs.ucla.edu (Paul Eggert) wrote:
-- Subject: Re: [tz] localtime.c patch

| I hope the attached proposed patch fixes all these problems; please let us
| know if it misses anything.

Yes, this looks good. There were other NetBSD changes that were
not carried forward, and perhaps they should:

	- localtime and friends can return NULL. This is not
	  mentioned in the man pages or handled properly. Specially
	  annoying is that ctime() just calls asctime(localtime())
	  without checking the result of localtime and this can
	  make programs coredump without giving them a chance to
	  handle the error.

	- timesub() doesn't set errno on overflow so none of the API
	  functions that go through this error path set errno when
	  they fail.

It would be nice if the error conditions of all the functions were
documented in the man pages and the errors were formalized (i.e.
have them always set errno consistently depending on the error



More information about the tz mailing list