aboutsummaryrefslogtreecommitdiff
path: root/libio
diff options
context:
space:
mode:
authorFrederic Berat <fberat@redhat.com>2023-06-12 17:18:20 +0200
committerSiddhesh Poyarekar <siddhesh@sourceware.org>2023-06-13 19:59:08 -0400
commita84dcb4bdfe5070f2327da693d8b025c89b4877a (patch)
treee551263f0622ab6dd69fe3ff1adf4aa0790320a9 /libio
parent127c21c0e2f669454835f78fc03079866282c19b (diff)
downloadglibc-a84dcb4bdfe5070f2327da693d8b025c89b4877a.zip
glibc-a84dcb4bdfe5070f2327da693d8b025c89b4877a.tar.gz
glibc-a84dcb4bdfe5070f2327da693d8b025c89b4877a.tar.bz2
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 <siddhesh@sourceware.org>
Diffstat (limited to 'libio')
-rw-r--r--libio/bug-fseek.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/libio/bug-fseek.c b/libio/bug-fseek.c
index 1b60580..19d5e24 100644
--- a/libio/bug-fseek.c
+++ b/libio/bug-fseek.c
@@ -3,6 +3,7 @@
#include <stdlib.h>
#include <unistd.h>
+#include <support/xstdio.h>
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");