handle strftime() more defensively
authorPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 4 Apr 2019 14:26:09 +0000 (16:26 +0200)
committerPhilipp Gesang <philipp.gesang@intra2net.com>
Thu, 4 Apr 2019 14:31:30 +0000 (16:31 +0200)
commitcb5f6477e5134d78b0d336ff9c8c91750483dc7a
tree294e3e43460d2ef2af6df3b7c4ccbd37770aa461
parentf8ebfa53b206d9ac33762f55da743b4670332035
handle strftime() more defensively

Null terminating the result is not necessary under the assumption
that the function works as advertised since we start out with a
zeroed buffer. Thus drop the calculation based on its return
value and null terminate the final byte instead -- after all if
the function should be borked we have no idea where the
terminator should go.

Also error out if it returns zero since the ISO time format cannot
result in the empty string.
src/timefunc.cpp