afh: Use write_all rather than plain write().
[paraslash.git] / afh.c
diff --git a/afh.c b/afh.c
index f2745b61b47e67310ce89dd78d9b95944021a7a4..b76c72fdab6dbe445b1466de76c4f3dd58e33b92 100644 (file)
--- a/afh.c
+++ b/afh.c
@@ -124,7 +124,7 @@ static int cat_file(struct afh_info *afhi, int audio_format_id,
                        &header, &size);
                if (size > 0) {
                        PARA_INFO_LOG("writing header (%zu bytes)\n", size);
-                       ret = write(STDOUT_FILENO, header, size); /* FIXME */
+                       ret = write_all(STDOUT_FILENO, header, size);
                        afh_free_header(header, audio_format_id);
                        if (ret < 0)
                                return ret;
@@ -152,7 +152,7 @@ static int cat_file(struct afh_info *afhi, int audio_format_id,
                if (!size)
                        continue;
                PARA_INFO_LOG("writing chunk %lu\n", i);
-               ret = write_all(STDOUT_FILENO, buf, &size);
+               ret = write_all(STDOUT_FILENO, buf, size);
                if (ret < 0)
                        return ret;
        }