+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.
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
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