Skip to content

Commit

Permalink
Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Apr 15, 2002
1 parent 79fb32f commit c930dac
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/events/SDL_events.c
Expand Up @@ -372,7 +372,10 @@ int SDL_PollEvent (SDL_Event *event)
{
SDL_PumpEvents();

return(SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS));
/* We can't return -1, just return 0 (no event) on error */
if ( SDL_PeepEvents(event, 1, SDL_GETEVENT, SDL_ALLEVENTS) <= 0 )
return 0;
return 1;
}

int SDL_WaitEvent (SDL_Event *event)
Expand Down

0 comments on commit c930dac

Please sign in to comment.