Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
authorSam Lantinga <slouken@libsdl.org>
Mon, 15 Apr 2002 04:51:26 +0000
changeset 352 b49fc922e7f6
parent 351 b1cae30740a2
child 353 d47637068e52
Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
src/events/SDL_events.c
--- a/src/events/SDL_events.c	Sun Apr 14 22:17:50 2002 +0000
+++ b/src/events/SDL_events.c	Mon Apr 15 04:51:26 2002 +0000
@@ -372,7 +372,10 @@
 {
 	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)