Skip to content

Commit

Permalink
Date: Mon, 27 Dec 2004 19:08:30 +0100
Browse files Browse the repository at this point in the history
From: Gautier Portet
Subject: [SDL] Re: Mix_LoadMUS_RW in SDL_Mixer 1.2.6

Sam Lantinga wrote:
>>  static BOOL _mm_RWopsReader_Eof(MREADER* reader)
>>  {
>>-     if ( ((MRWOPSREADER*)reader)->end ==
>>+     if ( ((MRWOPSREADER*)reader)->end <
>>                      SDL_RWtell(((MRWOPSREADER*)reader)->rw) ) return
1;
>>      else return 0;
>>  }
>
>
> Shouldn't that be <= ?
> We're testing whether or not we're at end of file, and it seems like 'end'
> would be the index of the end of the file?  e.g. end = 0, tell = 0 == EOF ?

I tested both, only < is working.
I just tried with a small test, and feof() return 1 only if we are
*past* fseek(f,0,SEEK_END). and so mikmod expect the same.

Gautier
  • Loading branch information
slouken committed Jan 29, 2006
1 parent d2f14e7 commit f97650d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion mikmod/mmio.c
Expand Up @@ -82,7 +82,7 @@ typedef struct MRWOPSREADER {

static BOOL _mm_RWopsReader_Eof(MREADER* reader)
{
if ( ((MRWOPSREADER*)reader)->end ==
if ( ((MRWOPSREADER*)reader)->end <
SDL_RWtell(((MRWOPSREADER*)reader)->rw) ) return 1;
else return 0;
}
Expand Down

0 comments on commit f97650d

Please sign in to comment.