aa5a8fe
strftime() return value doesn't count NULL character, but buffer size must include it.
aa5a8fe28
Functions like localtime, gmtime and asctime are not thread safe as they (might) reuse the same buffer. So use the safer _s/_r variant for localtime and gmtime, and use strftime in favour of asctime.