From: Jim Meyering Date: Fri, 20 Dec 2019 04:17:27 +0000 (-0800) Subject: nstrftime: avoid a shadowing warning X-Git-Tag: v1.0~4469 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=009b4fbe4a905995c40660550fc95bfa3a86c3c2;p=gnulib.git 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. --- 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);