diff options
-rw-r--r-- | utils.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -109,7 +109,7 @@ binary_print(const char *s, ssize_t len) void xfwrite(const void *ptr, size_t size, FILE *stream) { - if (fwrite(ptr, size, 1, stream) != 1) { + if (size && fwrite(ptr, size, 1, stream) != 1) { msg(MSG_CRITICAL, "Failed to write to file: %s\n", strerror(errno)); exit(EXIT_FAILURE); |