public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug time/29396] New: strftime should set errno on failure
@ 2022-07-23  1:52 jscott at posteo dot net
  2022-07-23  1:53 ` [Bug time/29396] " jscott at posteo dot net
  2022-07-23  2:45 ` [Bug time/29396] strftime should set errno to ERANGE " jscott at posteo dot net
  0 siblings, 2 replies; 3+ messages in thread
From: jscott at posteo dot net @ 2022-07-23  1:52 UTC (permalink / raw)
  To: glibc-bugs

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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug time/29396] strftime should set errno on failure
  2022-07-23  1:52 [Bug time/29396] New: strftime should set errno on failure jscott at posteo dot net
@ 2022-07-23  1:53 ` jscott at posteo dot net
  2022-07-23  2:45 ` [Bug time/29396] strftime should set errno to ERANGE " jscott at posteo dot net
  1 sibling, 0 replies; 3+ messages in thread
From: jscott at posteo dot net @ 2022-07-23  1:53 UTC (permalink / raw)
  To: glibc-bugs

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

John Scott <jscott at posteo dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://austingroupbugs.net
                   |                            |/view.php?id=1386

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [Bug time/29396] strftime should set errno to ERANGE on failure
  2022-07-23  1:52 [Bug time/29396] New: strftime should set errno on failure jscott at posteo dot net
  2022-07-23  1:53 ` [Bug time/29396] " jscott at posteo dot net
@ 2022-07-23  2:45 ` jscott at posteo dot net
  1 sibling, 0 replies; 3+ messages in thread
From: jscott at posteo dot net @ 2022-07-23  2:45 UTC (permalink / raw)
  To: glibc-bugs

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

John Scott <jscott at posteo dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|minor                       |enhancement
            Summary|strftime should set errno   |strftime should set errno
                   |on failure                  |to ERANGE on failure

--- Comment #1 from John Scott <jscott at posteo dot net> ---
It was pointed out to me by [Rich
Felker](https://www.openwall.com/lists/musl/2022/07/23/2) that strftime is
required to succeed as long as the output buffer is large enough. Sorry for the
noise, I'm downgrading this to an enhancement

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-07-23  2:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-07-23  1:52 [Bug time/29396] New: strftime should set errno on failure jscott at posteo dot net
2022-07-23  1:53 ` [Bug time/29396] " jscott at posteo dot net
2022-07-23  2:45 ` [Bug time/29396] strftime should set errno to ERANGE " jscott at posteo dot net

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).