diff options
author | Frédéric Bérat <fberat@redhat.com> | 2023-06-02 17:28:06 +0200 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@sourceware.org> | 2023-06-06 08:23:53 -0400 |
commit | 8c4f69d711481a18c70cb9a6c0a5367604894320 (patch) | |
tree | 7dc913567c6c1975b94217c48131fb6b3eb1d98d /posix/tst-execle2.c | |
parent | 7d421209287a07db5e926552ae5fbe9d8abb50dc (diff) | |
download | glibc-8c4f69d711481a18c70cb9a6c0a5367604894320.zip glibc-8c4f69d711481a18c70cb9a6c0a5367604894320.tar.gz glibc-8c4f69d711481a18c70cb9a6c0a5367604894320.tar.bz2 |
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 'posix/tst-execle2.c')
-rw-r--r-- | posix/tst-execle2.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/posix/tst-execle2.c b/posix/tst-execle2.c index 0430b7b..8e3ad9a 100644 --- a/posix/tst-execle2.c +++ b/posix/tst-execle2.c @@ -18,12 +18,8 @@ prepare (int argc, char *argv[]) { char *buf; int off; - asprintf (&buf, "cp %s %n%s-copy", argv[0], &off, argv[0]); - if (buf == NULL) - { - puts ("asprintf failed"); - exit (1); - } + + buf = xasprintf ("cp %s %n%s-copy", argv[0], &off, argv[0]); if (system (buf) != 0) { puts ("system failed"); |