[PATCH v2 2/2] [BZ #16141] strptime: fix %z minutes calculation
James Perkins
james@loowit.net
Wed Dec 3 22:32:00 GMT 2014
On Wed, Dec 3, 2014 at 1:46 AM, Will Newton <will.newton@linaro.org> wrote:
> On 3 December 2014 at 02:27, James Perkins <james@loowit.net> wrote:
>> This is a fix for [BZ #16141] strptime %z offset restriction.
>> + /* minutes valid range is 0 through 59. */
>
> Comment should start with a capital and have two spaces at the end.
Happy to oblige, Will. I will rework the comment.
>> /* valid range UTC-24 to +25, ala POSIX */
>> if (neg && val > 2400)
>> return NULL;
>> if (!neg && val > 2500)
>> return NULL;
>
> Are these conditions still correct?
No, the conditions are not correct; after discussion with Paul Eggert I propose
that the code drop the range limit entirely and support -9959 to +9959,
converting these to the appropriate seconds tm_gmtoff field.
> It would be good to add a test case or two to ensure the changes work
> as intended.
I'm adding test cases for the existing errors as well as the range changes.
Cheers,
James
--
James Perkins <james@loowit.net> KN1X www.loowit.net/~james
2094 Arthur St, Eugene, OR 97405 +1.971.344.3969 mobile
More information about the Libc-alpha
mailing list