about summary refs log tree commit diff
path: root/stdio-common/test-fwrite.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/test-fwrite.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/test-fwrite.c')
-rw-r--r--stdio-common/test-fwrite.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/stdio-common/test-fwrite.c b/stdio-common/test-fwrite.c
index 5677c6da80..7f383921ca 100644
--- a/stdio-common/test-fwrite.c
+++ b/stdio-common/test-fwrite.c
@@ -1,6 +1,8 @@
 #include <stdio.h>
 #include <string.h>
 
+#include <support/support.h>
+
 static int
 do_test (void)
 {
@@ -57,7 +59,7 @@ do_test (void)
       return 1;
     }
 
-  asprintf (&line, "\
+  line = xasprintf ("\
 GDB is free software and you are welcome to distribute copies of it\n\
  under certain conditions; type \"show copying\" to see the conditions.\n\
 There is absolutely no warranty for GDB; type \"show warranty\" for details.\n\