aboutsummaryrefslogtreecommitdiff
path: root/bfd/doc/chew.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/doc/chew.c')
-rw-r--r--bfd/doc/chew.c5
1 files changed, 4 insertions, 1 deletions
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