diff src/events/SDL_events.c @ 352:b49fc922e7f6

Fixed SDL_PollEvent() so it only returns a boolean value (not -1)
author Sam Lantinga <slouken@libsdl.org>
date Mon, 15 Apr 2002 04:51:26 +0000
parents f6ffac90895c
children d47637068e52
line wrap: on
line diff
--- 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)