bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] fix not a string literal warning in test_xasprintf


From: Gilles Espinasse
Subject: [PATCH] fix not a string literal warning in test_xasprintf
Date: Sat, 31 Mar 2012 17:44:28 +0200

Visible with gcc-4.4.5 with defaults-format-security.patch

test-xvasprintf.c: In function 'test_xasprintf':
test-xvasprintf.c:98: warning: format not a string literal and no format 
arguments

Signed-off-by: Gilles Espinasse <address@hidden>
---
 tests/test-xvasprintf.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/tests/test-xvasprintf.c b/tests/test-xvasprintf.c
index 4a90059..fc54d94 100644
--- a/tests/test-xvasprintf.c
+++ b/tests/test-xvasprintf.c
@@ -95,7 +95,7 @@ test_xasprintf (void)
   {
     /* Silence gcc warning about zero-length format string.  */
     const char *empty = "";
-    result = xasprintf (empty);
+    result = xasprintf ("%s", empty);
     ASSERT (result != NULL);
     ASSERT (strcmp (result, "") == 0);
     free (result);
-- 
1.5.6.5




reply via email to

[Prev in Thread] Current Thread [Next in Thread]