From 009b4fbe4a905995c40660550fc95bfa3a86c3c2 Mon Sep 17 00:00:00 2001 From: Jim Meyering Date: Thu, 19 Dec 2019 20:17:27 -0800 Subject: [PATCH] nstrftime: avoid a shadowing warning * lib/nstrftime.c (libc_hidden_def): Rename inner "i" to "j", to avoid shadowing an "i" declared hundreds of lines above. --- ChangeLog | 6 ++++++ lib/nstrftime.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index b58c7b851f..84662a18ae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2019-12-19 Jim Meyering + + nstrftime: avoid a shadowing warning + * lib/nstrftime.c (libc_hidden_def): Rename inner "i" to "j", + to avoid shadowing an "i" declared hundreds of lines above. + 2019-12-19 Paul Eggert dfa: struct dfamust now uses flexible array diff --git a/lib/nstrftime.c b/lib/nstrftime.c index ada767613f..23b0a64608 100644 --- a/lib/nstrftime.c +++ b/lib/nstrftime.c @@ -1138,8 +1138,8 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG (size_t maxsize) int ndigs = ns_digits; while (width < ndigs || (1 < ndigs && n % 10 == 0)) ndigs--, n /= 10; - for (int i = ndigs; 0 < i; i--) - buf[i - 1] = n % 10 + L_('0'), n /= 10; + for (int j = ndigs; 0 < j; j--) + buf[j - 1] = n % 10 + L_('0'), n /= 10; if (!pad) pad = L_('0'); width_cpy (0, ndigs, buf); -- 2.39.5