Eliminate compiler warning

This commit is contained in:
oparviai 2009-01-25 16:30:53 +00:00
parent 04d39cb02e
commit 9eb650cd1e

View File

@ -630,6 +630,7 @@ void WavOutFile::finishHeader()
void WavOutFile::writeHeader()
{
WavHeader hdrTemp;
int res;
// swap byte order if necessary
hdrTemp = header;
@ -645,7 +646,12 @@ void WavOutFile::writeHeader()
// write the supplemented header in the beginning of the file
fseek(fptr, 0, SEEK_SET);
fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr);
res = fwrite(&hdrTemp, sizeof(hdrTemp), 1, fptr);
if (res != 1)
{
throw runtime_error("Error while writing to a wav file.");
}
// jump back to the end of the file
fseek(fptr, 0, SEEK_END);
}