From 8c4f69d711481a18c70cb9a6c0a5367604894320 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20B=C3=A9rat?= Date: Fri, 2 Jun 2023 17:28:06 +0200 Subject: 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 --- posix/tst-execle2.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'posix/tst-execle2.c') 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"); -- cgit v1.1