1 Commits
Author SHA1 Message Date
Doha Nam 6b53f80311 Fix strftime/1 and strflocaltime/1 to allow an empty result (#3670)
These functions failed with "unknown system failure" whenever strftime()
returned 0 for a non-empty format, but 0 also means the format expands to
an empty string, as %p does in a locale without AM/PM.

Prepend a character to the format and trim it from the result, so that 0
can only mean the result is too long. Now 0 | strflocaltime("%p") gives
"" in fr_FR.UTF-8, and a result that is still too long fails with
"result too long" error instead. The size limit is unchanged.
2026-10-13 16:47:58 +09:00