From: jdoubleu <hi@jdoubleu.de>
To: Jeff Johnston <jjohnstn@redhat.com>
Cc: newlib@sourceware.org
Subject: Re: [PATCH] add tests for tzset(3)
Date: Thu, 12 May 2022 20:35:53 +0200 [thread overview]
Message-ID: <361f9d4b-38ae-894d-e7a4-65a5ae3afb18@jdoubleu.de> (raw)
In-Reply-To: <CAOox84vEt8sb7HaUNFDa=MRbk_wQPj-7LQbF+rbcVKn==Hp1QQ@mail.gmail.com>
Hi Jeff,
I finally found some time to have a look at your patch.
> if (sscanf (tzenv, "%10[-+0-9A-Za-z]%n", __tzname_std, &n) <= 0
> || n < TZNAME_MIN || TZNAME_MAX < n || '>' != tzenv[n])
> + else if (n < TZNAME_MIN || TZNAME_MAX < n)
I think the sub-expression "TZNAME_MAX < n" can never be true, can it?
sscanf will always stop after 10 characters.
What do you think about including the TZNAME_MAX macro inside the format
string?
> #define STR(s) #s
> #define STR_LIT(s) STR(s)
> ...
> sscanf(tzenv, "%" STR_LIT(TZNAME_MAX) "[-+0-9A-Za-z]%n", __tzname_dst, &n)
I'll try to update the tests in the coming days, so I can verify your
changes work as expected.
Cheers
---
🙎🏻♂️ jdoubleu
On 4/29/2022 5:46 PM, Jeff Johnston wrote:
> I have revised my tzset_r.c patch so that the tzrules are initialized so we
> don't inherit the previous settings if not specified for a particular TZ.
> As well, I defaulted them if TZ is not specified.
>
> -- Jeff J.
next prev parent reply other threads:[~2022-05-12 18:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-29 15:46 Jeff Johnston
2022-05-12 18:35 ` jdoubleu [this message]
2022-05-16 17:49 ` Jeff Johnston
-- strict thread matches above, loose matches on Subject: below --
2022-04-07 15:58 jdoubleu
2022-04-08 21:21 ` Jeff Johnston
2022-04-10 8:43 ` Dimitar Dimitrov
2022-04-10 17:55 ` jdoubleu
2022-04-10 21:00 ` Dimitar Dimitrov
2022-04-11 11:17 ` jdoubleu
2022-04-11 17:27 ` Dimitar Dimitrov
2022-04-12 11:19 ` jdoubleu
2022-04-12 18:33 ` Brian Inglis
2022-04-07 23:34 ` [PATCH v2 0/2] add tzset/_r POSIX angle bracket <> support in TZ env var Brian Inglis
2022-04-13 17:53 ` [PATCH] add tests for tzset(3) Brian Inglis
2022-04-13 20:33 ` Jeff Johnston
2022-04-13 22:19 ` Brian Inglis
2022-04-14 8:59 ` jdoubleu
2022-04-14 16:31 ` Brian Inglis
2022-04-14 19:23 ` Jeff Johnston
2022-04-15 10:10 ` jdoubleu
2022-04-27 19:30 ` Jeff Johnston
2022-05-14 14:39 ` jdoubleu
2022-05-16 16:05 ` Dimitar Dimitrov
2022-05-16 17:38 ` Jeff Johnston
2022-04-13 22:21 ` Brian Inglis
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=361f9d4b-38ae-894d-e7a4-65a5ae3afb18@jdoubleu.de \
--to=hi@jdoubleu.de \
--cc=jjohnstn@redhat.com \
--cc=newlib@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).