summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Pavone <pavone@retrodev.com>2014-02-11 12:45:15 -0800
committerMichael Pavone <pavone@retrodev.com>2014-02-11 12:45:15 -0800
commit8a2df056c2612b1ce4748b46a194c3e07722986c (patch)
tree5701dc22d53087be5238554504457256d3436b15
parent9fb4d34b6a61b35380b2840a1e5ed94199dbbada (diff)
Fix check of fwrite return value in wave_finalize so that the data subchunk size gets written
-rw-r--r--wave.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wave.c b/wave.c
index af0b8b7..9a9171f 100644
--- a/wave.c
+++ b/wave.c
@@ -1,6 +1,6 @@
/*
Copyright 2013 Michael Pavone
- This file is part of BlastEm.
+ This file is part of BlastEm.
BlastEm is free software distributed under the terms of the GNU General Public License version 3 or greater. See COPYING for full license text.
*/
#include "wave.h"
@@ -31,13 +31,13 @@ int wave_finalize(FILE * f)
uint32_t size = ftell(f);
fseek(f, offsetof(wave_header, chunk.size), SEEK_SET);
size -= 8;
- if (fwrite(&size, sizeof(size), 1, f) != sizeof(size)) {
+ if (fwrite(&size, sizeof(size), 1, f) != 1) {
fclose(f);
return 0;
}
fseek(f, offsetof(wave_header, data_header.size), SEEK_SET);
size -= 36;
- if (fwrite(&size, sizeof(size), 1, f)) {
+ if (fwrite(&size, sizeof(size), 1, f) != 1) {
fclose(f);
return 0;
}