From add7092f5056afa8856e33e143e72f29d5c80ac3 Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 26 Apr 2025 10:49:38 +0200 Subject: [PATCH] vasnprintf: Fix -Wshadow=local warnings. * lib/vasnprintf.c (VASNPRINTF): Rename local variable 'i' to 'di'. --- ChangeLog | 5 +++++ lib/vasnprintf.c | 6 +++--- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index b7ab0df56b..1e7d87b8ad 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2025-04-26 Bruno Haible + + vasnprintf: Fix -Wshadow=local warnings. + * lib/vasnprintf.c (VASNPRINTF): Rename local variable 'i' to 'di'. + 2025-04-26 Bruno Haible Silence gcc 15 -Wunterminated-string-initialization warnings. diff --git a/lib/vasnprintf.c b/lib/vasnprintf.c index f1bfcf3161..a5a956603a 100644 --- a/lib/vasnprintf.c +++ b/lib/vasnprintf.c @@ -2517,7 +2517,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, TCHAR_T *buf; TCHAR_T *buf_malloced; const FCHAR_T *cp; - size_t i; + size_t di; DIRECTIVE *dp; /* Output string accumulator. */ DCHAR_T *result; @@ -2581,7 +2581,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, #define ENSURE_ALLOCATION(needed) \ ENSURE_ALLOCATION_ELSE((needed), goto out_of_memory; ) - for (cp = format, i = 0, dp = &d.dir[0]; ; cp = dp->dir_end, i++, dp++) + for (cp = format, di = 0, dp = &d.dir[0]; ; cp = dp->dir_end, di++, dp++) { if (cp != dp->dir_start) { @@ -2604,7 +2604,7 @@ VASNPRINTF (DCHAR_T *resultbuf, size_t *lengthp, while (--n > 0); } } - if (i == d.count) + if (di == d.count) break; /* Execute a single directive. */ -- 2.39.5