aboutsummaryrefslogtreecommitdiff
path: root/binutils/objdump.c
diff options
context:
space:
mode:
Diffstat (limited to 'binutils/objdump.c')
-rw-r--r--binutils/objdump.c9
1 files changed, 6 insertions, 3 deletions
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. */