From: Brian Inglis <Brian.Inglis@Shaw.ca>
To: cygwin-patches@cygwin.com
Cc: Pedro Luis Castedo Cepeda <pedroluis.castedo@upm.es>
Subject: Re: [PATCH] fix(libc): Fix handle of %E & %O modifiers at end of format string
Date: Thu, 9 Nov 2023 23:17:14 -0700 [thread overview]
Message-ID: <4801ab90-2958-4fa2-87f2-21efdb41bbf4@Shaw.ca> (raw)
In-Reply-To: <20231109190441.2826-1-pedroluis.castedo@upm.es>
On 2023-11-09 12:04, Pedro Luis Castedo Cepeda wrote:
> - Prevent strftime to parsing format string beyond its end when
> it finish with "%E" or "%O".
> ---
> newlib/libc/time/strftime.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c
> index 56f227c5f..c4e9e45a9 100644
> --- a/newlib/libc/time/strftime.c
> +++ b/newlib/libc/time/strftime.c
> @@ -754,6 +754,8 @@ __strftime (CHAR *s, size_t maxsize, const CHAR *format,
>
> switch (*format)
> {
> + case CQ('\0'):
> + break;
> case CQ('a'):
> _ctloc (wday[tim_p->tm_wday]);
> for (i = 0; i < ctloclen; i++)
These cases appear to already be taken care of by setting and using (depending
on the config parameters) the "alt" variable for those modifiers, and the
default: return 0; for the format *character* (possibly wide) not matching
following any modifiers.
Patches to newlib should go to the newlib mailing list at sourceware dot org.
--
Take care. Thanks, Brian Inglis Calgary, Alberta, Canada
La perfection est atteinte Perfection is achieved
non pas lorsqu'il n'y a plus rien à ajouter not when there is no more to add
mais lorsqu'il n'y a plus rien à retirer but when there is no more to cut
-- Antoine de Saint-Exupéry
next prev parent reply other threads:[~2023-11-10 6:17 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-09 19:04 Pedro Luis Castedo Cepeda
2023-11-10 6:17 ` Brian Inglis [this message]
2023-11-10 10:16 ` Corinna Vinschen
2023-11-10 17:44 ` Pedro Luis Castedo Cepeda
2023-11-11 5:57 ` Brian Inglis
2023-11-11 17:29 ` Pedro Luis Castedo Cepeda
2023-11-13 16:42 ` Corinna Vinschen
2023-11-13 18:46 ` 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=4801ab90-2958-4fa2-87f2-21efdb41bbf4@Shaw.ca \
--to=brian.inglis@shaw.ca \
--cc=cygwin-patches@cygwin.com \
--cc=pedroluis.castedo@upm.es \
/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).