From 001a627502df45968b52071d20854fca51d7db72 Mon Sep 17 00:00:00 2001 From: Glenn Maynard Date: Sun, 21 Sep 2003 00:35:08 +0000 Subject: [PATCH] Fix error returns. --- stepmania/src/RageSoundReader_WAV.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/stepmania/src/RageSoundReader_WAV.cpp b/stepmania/src/RageSoundReader_WAV.cpp index ad6b1428ed..4b25ef43ce 100644 --- a/stepmania/src/RageSoundReader_WAV.cpp +++ b/stepmania/src/RageSoundReader_WAV.cpp @@ -186,8 +186,7 @@ int RageSoundReader_WAV::seek_sample_fmt_normal( Uint32 ms ) const int pos = (int) (this->fmt.data_starting_offset + offset); int rc = fseek( this->rw, pos, SEEK_SET ); - if( rc != pos ) - return -1; + BAIL_IF_MACRO(rc == -1, strerror(errno), -1); return ms; } @@ -374,8 +373,7 @@ int RageSoundReader_WAV::seek_sample_fmt_adpcm( Uint32 ms ) const int pos = skipsize + this->fmt.data_starting_offset; int rc = fseek(this->rw, pos, SEEK_SET); - BAIL_IF_MACRO(rc == -1, strerror(errno), 0); - BAIL_IF_MACRO(rc != pos, "end of file", 0); + BAIL_IF_MACRO(rc == -1, strerror(errno), -1); /* The offset we need is in this block, so we need to decode to there. */ skipsize += (offset % bpb);