This is the mail archive of the
mailing list for the glibc project.
Re: [PATCH v2 2/2] [BZ #16141] strptime: fix %z minutes calculation
- From: James Perkins <james at loowit dot net>
- To: Will Newton <will dot newton at linaro dot org>
- Cc: libc-alpha <libc-alpha at sourceware dot org>
- Date: Wed, 3 Dec 2014 14:32:16 -0800
- Subject: Re: [PATCH v2 2/2] [BZ #16141] strptime: fix %z minutes calculation
- Authentication-results: sourceware.org; auth=none
- References: <1417573661-9902-1-git-send-email-james at loowit dot net> <1417573661-9902-2-git-send-email-james at loowit dot net> <CANu=DmiJQH=bTuUCgQ-KfJ4vw2PF1ag1_pMyd5pvzjn0DTzTqw at mail dot gmail dot com>
On Wed, Dec 3, 2014 at 1:46 AM, Will Newton <email@example.com> wrote:
> On 3 December 2014 at 02:27, James Perkins <firstname.lastname@example.org> 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.
James Perkins <email@example.com> KN1X www.loowit.net/~james
2094 Arthur St, Eugene, OR 97405 +1.971.344.3969 mobile