Landed
Fix strftime/1 and strflocaltime/1 to allow an empty result (#3670)
Landed as 6b53f80
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.
authored by Doha Nam · committed by the platform · parent 80fc7a1 · Browse files · 3 files+37 added−10 removed