Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240511212853.GS10433@brightrain.aerifal.cx>
Date: Sat, 11 May 2024 17:28:54 -0400
From: Rich Felker <dalias@...c.org>
To: Petr Pisar <petr.pisar@...as.cz>
Cc: musl@...ts.openwall.com
Subject: Re: strptime(s, "%Y-%j", &tm) does not update month and day

On Sat, May 11, 2024 at 05:24:59PM +0200, Petr Pisar wrote:
> Hello,
> 
> When debugging a libisds test failure with musl-1.2.5
> <https://bugs.gentoo.org/show_bug.cgi?id=928107>, I found that musl's
> strptime() does not handle "%Y-%j" properly. It accepts the format, it parses
> the input string, it returns a correct pointer past the input string, but it
> does not update tm.tm_mon and tm.tm_mday fileds of the third argument.

This is behaving as specified. Previously, the behavior was
unspecified. POSIX has amended it for future issues as the resolution
of https://austingroupbugs.net/view.php?id=1727 to read:

    The tm_yday member of the tm structure pointed to by tm shall be
    set to this number minus 1.

strptime generally does not behave like mktime, doing
normalizations/conversions.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.