about summary refs log tree commit diff
path: root/stdio-common/bug6.c
diff options
context:
space:
mode:
authorFrédéric Bérat <fberat@redhat.com>2023-06-01 16:27:47 +0200
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2023-06-01 13:01:32 -0400
commit29e25f6f136182fb3756d51e03dea7c4d1919dd9 (patch)
tree4d3950068c9fec569ae21055641b986632371fbb /stdio-common/bug6.c
parenta952fcda58cd7aa191140fc9e7d453df212b9117 (diff)
downloadglibc-29e25f6f136182fb3756d51e03dea7c4d1919dd9.tar.gz
glibc-29e25f6f136182fb3756d51e03dea7c4d1919dd9.tar.xz
glibc-29e25f6f136182fb3756d51e03dea7c4d1919dd9.zip
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 <siddhesh@sourceware.org>
Diffstat (limited to 'stdio-common/bug6.c')
-rw-r--r--stdio-common/bug6.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/stdio-common/bug6.c b/stdio-common/bug6.c
index 0db63a3b44..50098bf3f2 100644
--- a/stdio-common/bug6.c
+++ b/stdio-common/bug6.c
@@ -7,16 +7,16 @@ main (void)
   int i;
   int lost = 0;
 
-  scanf ("%2s", buf);
+  lost = (scanf ("%2s", buf) < 0);
   lost |= (buf[0] != 'X' || buf[1] != 'Y' || buf[2] != '\0');
   if (lost)
     puts ("test of %2s failed.");
-  scanf (" ");
-  scanf ("%d", &i);
+  lost |= (scanf (" ") < 0);
+  lost |= (scanf ("%d", &i) < 0);
   lost |= (i != 1234);
   if (lost)
     puts ("test of %d failed.");
-  scanf ("%c", buf);
+  lost |= (scanf ("%c", buf) < 0);
   lost |= (buf[0] != 'L');
   if (lost)
     puts ("test of %c failed.\n");