diff options
author | Michael Pavone <pavone@retrodev.com> | 2014-02-11 12:45:15 -0800 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2014-02-11 12:45:15 -0800 |
commit | 8a2df056c2612b1ce4748b46a194c3e07722986c (patch) | |
tree | 5701dc22d53087be5238554504457256d3436b15 /wave.c | |
parent | 9fb4d34b6a61b35380b2840a1e5ed94199dbbada (diff) |
Fix check of fwrite return value in wave_finalize so that the data subchunk size gets written
Diffstat (limited to 'wave.c')
-rw-r--r-- | wave.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -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; } |