From 615f314969111779bdaffaef0e00d13a0efd51f5 Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Mon, 15 Oct 2007 02:00:56 +0000 Subject: * objdump.c (print_line): Check fwrite return value. * srconv.c (checksum, wr_tr, wr_cs): Likewise. * sysdump.c (fillup): Return zero on getc or fread EOF. Return count read. --- binutils/objdump.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'binutils/objdump.c') diff --git a/binutils/objdump.c b/binutils/objdump.c index 03bc4d6..ee5530b 100644 --- a/binutils/objdump.c +++ b/binutils/objdump.c @@ -1130,14 +1130,17 @@ static void print_line (struct print_file_list *p, unsigned int line) { const char *l; + size_t len; --line; if (line >= p->maxline) return; l = p->linemap [line]; - fwrite (l, 1, strcspn (l, "\n\r"), stdout); - putchar ('\n'); -} + /* Test fwrite return value to quiet glibc warning. */ + len = strcspn (l, "\n\r"); + if (len == 0 || fwrite (l, len, 1, stdout) == 1) + putchar ('\n'); +} /* Print a range of source code lines. */ -- cgit v1.1