[Bug time/29396] New: strftime should set errno on failure

jscott at posteo dot net sourceware-bugzilla@sourceware.org
Sat Jul 23 01:52:39 GMT 2022


https://sourceware.org/bugzilla/show_bug.cgi?id=29396

            Bug ID: 29396
           Summary: strftime should set errno on failure
           Product: glibc
           Version: 2.36
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: time
          Assignee: unassigned at sourceware dot org
          Reporter: jscott at posteo dot net
  Target Milestone: ---

Hi,

Right now, there is no way to distinguish the buffer being too small from other
causes of error in strftime(), so there's no way for a caller to know whether
it should allocate a larger buffer and try again. POSIX Issue 8 is slated to
require that errno be set to ERANGE when the output buffer isn't big enough,
and also that errno be set in other failure situations. I think glibc should
adopt this behavior even if it weren't to be standardized since it's valuable
to application developers such as myself.

Thanks for your attention to this matter :)

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the Glibc-bugs mailing list