changeset 15380:84ad6dbce2a8

test-snprintf: avoid compiler warning * 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>
author Eric Blake <eblake@redhat.com>
date Fri, 08 Jul 2011 15:57:31 -0600
parents ca34a467b2b5
children dbd7d36edadc
files ChangeLog tests/test-snprintf.c tests/test-vsnprintf.c
diffstat 3 files changed, 9 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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'.
--- a/tests/test-snprintf.c
+++ b/tests/test-snprintf.c
@@ -63,7 +63,7 @@
   /* 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));
   }
--- a/tests/test-vsnprintf.c
+++ b/tests/test-vsnprintf.c
@@ -76,7 +76,7 @@
   /* 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));
   }