test-snprintf: avoid compiler warning
authorEric Blake <eblake@redhat.com>
Fri, 8 Jul 2011 21:57:31 +0000 (15:57 -0600)
committerEric Blake <eblake@redhat.com>
Fri, 8 Jul 2011 21:57:31 +0000 (15:57 -0600)
* tests/test-snprintf.c (main): Avoid shadowed declaration.
* tests/test-vsnprintf.c (main): Likewise.
Reported by Jim Meyering.

Signed-off-by: Eric Blake <eblake@redhat.com>
ChangeLog
tests/test-snprintf.c
tests/test-vsnprintf.c

index 465ccafe9819bcbfc2d670ca00ec789b08da4710..2465f4c04d1964119a5d706bc70716307e9d452f 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2011-07-08  Eric Blake  <eblake@redhat.com>
+
+       test-snprintf: avoid compiler warning
+       * tests/test-snprintf.c (main): Avoid shadowed declaration.
+       * tests/test-vsnprintf.c (main): Likewise.
+       Reported by Jim Meyering.
+
 2011-07-08  Bruno Haible  <bruno@clisp.org>
 
        Tests for module 'pthread_sigmask'.
index 18efed5185100dde35e7f4d61c8fd4d356bbaef7..2b5a54c4af183953e3a2e97b7273a4edb8714ce8 100644 (file)
@@ -63,7 +63,7 @@ main (int argc, char *argv[])
   /* Test the support of the POSIX/XSI format strings with positions.  */
   {
     char result[100];
-    int retval = snprintf (result, sizeof (result), "%2$d %1$d", 33, 55);
+    retval = snprintf (result, sizeof (result), "%2$d %1$d", 33, 55);
     ASSERT (strcmp (result, "55 33") == 0);
     ASSERT (retval == strlen (result));
   }
index 6711f39b6ab459542a0d0523c970e16844fb3619..7a520824bbed147451d712cf6535fa9f4afc5299 100644 (file)
@@ -76,7 +76,7 @@ main (int argc, char *argv[])
   /* Test the support of the POSIX/XSI format strings with positions.  */
   {
     char result[100];
-    int retval = my_snprintf (result, sizeof (result), "%2$d %1$d", 33, 55);
+    retval = my_snprintf (result, sizeof (result), "%2$d %1$d", 33, 55);
     ASSERT (strcmp (result, "55 33") == 0);
     ASSERT (retval == strlen (result));
   }