From a84dcb4bdfe5070f2327da693d8b025c89b4877a Mon Sep 17 00:00:00 2001 From: Frederic Berat Date: Mon, 12 Jun 2023 17:18:20 +0200 Subject: tests: replace fread by xfread With fortification enabled, fread calls return result needs to be checked, has it gets the __wur macro enabled. Reviewed-by: Siddhesh Poyarekar --- libio/bug-fseek.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'libio') diff --git a/libio/bug-fseek.c b/libio/bug-fseek.c index 1b60580b53..19d5e2429e 100644 --- a/libio/bug-fseek.c +++ b/libio/bug-fseek.c @@ -3,6 +3,7 @@ #include #include +#include static char *fname; @@ -48,7 +49,7 @@ do_test (void) perror ("fopen(\"r\")"); } - fread (buf, 3, 1, f); + xfread (buf, 3, 1, f); errno = 0; if (fseek (f, -10, SEEK_CUR) == 0) { @@ -72,7 +73,7 @@ Got %d instead\n", perror ("fopen(\"r+\")"); } - fread (buf, 3, 1, f); + xfread (buf, 3, 1, f); errno = 0; if (fseek (f, -10, SEEK_CUR) == 0) { @@ -96,7 +97,7 @@ Got %d instead\n", perror ("fopen(\"r+\")"); } - fread (buf, 3, 1, f); + xfread (buf, 3, 1, f); if (ftell (f) != 3) { puts ("ftell failed"); -- cgit 1.4.1