]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime: avoid a shadowing warning
authorJim Meyering <meyering@fb.com>
Fri, 20 Dec 2019 04:17:27 +0000 (20:17 -0800)
committerJim Meyering <meyering@fb.com>
Fri, 20 Dec 2019 04:17:27 +0000 (20:17 -0800)
* lib/nstrftime.c (libc_hidden_def): Rename inner "i" to "j",
to avoid shadowing an "i" declared hundreds of lines above.

ChangeLog
lib/nstrftime.c

index b58c7b851fcae8757cc01c5c320bc43415d726a4..84662a18ae9ed859a235e93c539732061693c0b8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2019-12-19  Jim Meyering  <meyering@fb.com>
+
+       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  <eggert@cs.ucla.edu>
 
        dfa: struct dfamust now uses flexible array
index ada767613fc1e5856619a4386d5d4b98918c07aa..23b0a64608c4402c80de42e4dd5f07fd5901807c 100644 (file)
@@ -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);