diff options
author | Alan Modra <amodra@gmail.com> | 2007-10-15 02:00:28 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2007-10-15 02:00:28 +0000 |
commit | 5375ec41bea0ede4ebb4ef8afdc5df82466b3db9 (patch) | |
tree | 93d00b377076ff0bdfb98366156bce64779f745e /bfd | |
parent | b1657152098cd6a327e6d308bae00573b8c33daf (diff) | |
download | gdb-5375ec41bea0ede4ebb4ef8afdc5df82466b3db9.zip gdb-5375ec41bea0ede4ebb4ef8afdc5df82466b3db9.tar.gz gdb-5375ec41bea0ede4ebb4ef8afdc5df82466b3db9.tar.bz2 |
* chew.c (write_buffer): Check fwrite return value.
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/doc/ChangeLog | 4 | ||||
-rw-r--r-- | bfd/doc/chew.c | 5 |
2 files changed, 8 insertions, 1 deletions
diff --git a/bfd/doc/ChangeLog b/bfd/doc/ChangeLog index b0fec4a..51c7194 100644 --- a/bfd/doc/ChangeLog +++ b/bfd/doc/ChangeLog @@ -1,3 +1,7 @@ +2007-10-15 Alan Modra <amodra@bigpond.net.au> + + * chew.c (write_buffer): Check fwrite return value. + 2007-09-14 Alan Modra <amodra@bigpond.net.au> * Makefile.in: Regenerate. diff --git a/bfd/doc/chew.c b/bfd/doc/chew.c index 344fa43..5622ff2 100644 --- a/bfd/doc/chew.c +++ b/bfd/doc/chew.c @@ -120,6 +120,7 @@ static void overwrite_string (string_type *, string_type *); static void catbuf (string_type *, char *, unsigned int); static void cattext (string_type *, char *); static void catstr (string_type *, string_type *); +static void die (char *); #endif static void @@ -162,7 +163,9 @@ write_buffer (buffer, f) string_type *buffer; FILE *f; { - fwrite (buffer->ptr, buffer->write_idx, 1, f); + if (buffer->write_idx != 0 + && fwrite (buffer->ptr, buffer->write_idx, 1, f) != 1) + die ("cannot write output"); } static void |