From 29e25f6f136182fb3756d51e03dea7c4d1919dd9 Mon Sep 17 00:00:00 2001 From: Frédéric Bérat Date: Thu, 1 Jun 2023 16:27:47 +0200 Subject: tests: fix warn unused results With fortification enabled, few function calls return result need to be checked, has they get the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar --- support/test-container.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'support') diff --git a/support/test-container.c b/support/test-container.c index d4ca41fe7c..008ced2d25 100644 --- a/support/test-container.c +++ b/support/test-container.c @@ -714,8 +714,8 @@ check_for_unshare_hints (int require_pidns) continue; val = -1; /* Sentinel. */ - fscanf (f, "%d", &val); - if (val != files[i].bad_value) + int cnt = fscanf (f, "%d", &val); + if (cnt == 1 && val != files[i].bad_value) continue; printf ("To enable test-container, please run this as root:\n"); -- cgit 1.4.1