iso8601_leap_table_load() had an incorrect ‘nonnull’ attribute, which could
lead to crashes as the compiled code could omit the test for null which then
substitutes the system default. Fix it by removing the attribute.
While perhaps not strictly valid, negative timestamps can potentially be
returned by the C library and passed in to iso8601_from_ts() etc. This commit
adds a check for such timestamps and copes with the gracefully, whereas
previously invalid ISO8601 timestamps would have been generated.
iso8601_difference was incorrectly marked as having all of its attributes
required to be non-null, but this is not the case according to the docs or
the implementation. This was causing a crash as the compiled library was
taking advantage of the nonnull notation to remove some tests against null
which, according to the docs, are actually required.
Fix by tightening the nonnull specification to those parameters which actually
require it.
This commit updates the Doxygen documentation (particularly taking into account
a request from Kelly Dunlop for more verbose notice about which members are
changed by iso8601_from_*()) and file/function annotation/formatting to current
standards.
When adding a number of nanoseconds so that the resultant date lies exactly on
a second boundary, rounding was not performed when it should have been. Fix
the rounding so that the seconds field rolls over.
To avoid memory leaks, we add a simple internal mechanism to free the table
of leap seconds if it was previously loaded from disk. The user is still
responsible for freeing their own tables, of course.
This utility provides a way to display dates in ISO8601 format. The
exact output format can be controlled. It can either display dates
passed on the commandline or it can display the current date/time.