From a8526cb52bedabd4d6ba4b227a5185627f871aa1 Mon Sep 17 00:00:00 2001 From: Corinna Vinschen Date: Sat, 29 Oct 2022 20:15:58 +0200 Subject: [PATCH] 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 --- 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