Hi, My apologies, I don't have a patch, but I think strftime() should set errno on failure as POSIX Issue 8 stipulates: https://austingroupbugs.net/view.php?id=1386 I think this functionality is valuable enough that I'd really love it to be implemented soon, even if it doesn't make it into the final standard for whatever reason. Right now, when one gets a return value of 0, there is no way to distinguish the buffer being too small from other causes of error, which means there's no way to tell whether a caller should try reallocating with a larger buffer. Since strftime() is not snprintf-like (but perhaps it could be as an extension since passing NULL to strftime is undefined, not that I'm actually recommending that), there's no way to know how big of a buffer is big enough. Indeed, it's not even clear if NL_TEXTMAX applies here. Setting errno to ERANGE would let the caller know whether a larger buffer should be tried or if the effort will fruitlessly allocate large amounts of memory. Thank you.