public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] strftime/wcsftime: use STRLEN, not strlen
@ 2022-10-29 19:02 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2022-10-29 19:02 UTC (permalink / raw)
To: newlib-cvs
https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=a8526cb52bedabd4d6ba4b227a5185627f871aa1
commit a8526cb52bedabd4d6ba4b227a5185627f871aa1
Author: Corinna Vinschen <corinna@vinschen.de>
Date: Sat Oct 29 20:15:58 2022 +0200
strftime/wcsftime: use STRLEN, not strlen
Commit 737e2004a3bb accidentally introduced a call to strlen in
code used with wide character strings in case of wcsftime. Use
STRLEN instead.
Fixes: 737e2004a3bb ("strftime.c(__strftime): add %q, %v, tests; tweak %Z doc")
Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diff:
---
newlib/libc/time/strftime.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/newlib/libc/time/strftime.c b/newlib/libc/time/strftime.c
index 420745d90..56f227c5f 100644
--- a/newlib/libc/time/strftime.c
+++ b/newlib/libc/time/strftime.c
@@ -1260,7 +1260,7 @@ recurse:
format. Recurse to avoid need to replicate %b and %Y formation. */
CHAR fmtbuf[32], *fmt = fmtbuf;
STRCPY (fmt, CQ("%e-%b-%"));
- fmt += strlen (fmt);
+ fmt += STRLEN (fmt);
if (pad) /* '0' or '+' */
*fmt++ = pad;
else
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2022-10-29 19:02 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-10-29 19:02 [newlib-cygwin] strftime/wcsftime: use STRLEN, not strlen Corinna Vinschen
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).