Skip to content

Commit

Permalink
music_mod.c: fix LMM_Seek (thanks Ozkan!)
Browse files Browse the repository at this point in the history
old mikmod headers interchangingly used int and BOOL which led to confusions.
MREADER->Seek() function must behave the same as fseek() itself, adjusted it accordingly.
  • Loading branch information
slouken committed Oct 16, 2017
1 parent c69ff58 commit c76447d
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions music_mod.c
Expand Up @@ -149,14 +149,16 @@ typedef struct
SDL_RWops *src;
} LMM_MREADER;

BOOL LMM_Seek(struct MREADER *mr,long to,int dir)
int LMM_Seek(struct MREADER *mr,long to,int dir)
{
Sint64 offset = to;
LMM_MREADER* lmmmr = (LMM_MREADER*)mr;
if ( dir == SEEK_SET ) {
offset += lmmmr->offset;
if (offset < lmmmr->offset)
return -1;
}
return (SDL_RWseek(lmmmr->src, offset, dir) < lmmmr->offset);
return (int)(SDL_RWseek(lmmmr->src, offset, dir));
}
long LMM_Tell(struct MREADER *mr)
{
Expand Down

0 comments on commit c76447d

Please sign in to comment.