about summary refs log tree commit diff
path: root/stdio-common/bug5.c
diff options
context:
space:
mode:
authorFrédéric Bérat <fberat@redhat.com>2023-06-02 17:28:06 +0200
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2023-06-06 08:23:53 -0400
commit8c4f69d711481a18c70cb9a6c0a5367604894320 (patch)
tree7dc913567c6c1975b94217c48131fb6b3eb1d98d /stdio-common/bug5.c
parent7d421209287a07db5e926552ae5fbe9d8abb50dc (diff)
downloadglibc-8c4f69d711481a18c70cb9a6c0a5367604894320.tar.gz
glibc-8c4f69d711481a18c70cb9a6c0a5367604894320.tar.xz
glibc-8c4f69d711481a18c70cb9a6c0a5367604894320.zip
tests: fix warn unused result on asprintf calls
When enabling _FORTIFY_SOURCE, some functions now lead to warnings when
their result is not checked.

Reviewed-by: Siddhesh Poyarekar <siddhesh@sourceware.org>
Diffstat (limited to 'stdio-common/bug5.c')
-rw-r--r--stdio-common/bug5.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdio-common/bug5.c b/stdio-common/bug5.c
index 7bfe9b2b8d..dfa19aed55 100644
--- a/stdio-common/bug5.c
+++ b/stdio-common/bug5.c
@@ -7,6 +7,8 @@
 #include <stdlib.h>
 #include <unistd.h>
 
+#include <support/support.h>
+
 static char buf[8192];
 
 int
@@ -60,7 +62,7 @@ main (void)
      the perhaps incompatible new shared libraries.  */
   unsetenv ("LD_LIBRARY_PATH");
 
-  asprintf (&printbuf, "cmp %s %s", inname, outname);
+  printbuf = xasprintf ("cmp %s %s", inname, outname);
   result = system (printbuf);
   remove (inname);
   remove (outname);