Parcourir la source

events: fix SDL_PeepEvents() returning 0 on error

Signed-off-by: Amelia Clarke <selene@perilune.dev>
(cherry picked from commit defd7895da3253064653dc56fb34f1b98b538aa4)
Amelia Clarke il y a 3 mois
Parent
commit
c61f97dbce
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  1. 2 1
      src/events/SDL_events.c

+ 2 - 1
src/events/SDL_events.c

@@ -1108,7 +1108,8 @@ static int SDL_PeepEventsInternal(SDL_Event *events, int numevents, SDL_EventAct
         if (action == SDL_ADDEVENT) {
             if (!events) {
                 SDL_UnlockMutex(SDL_EventQ.lock);
-                return SDL_InvalidParamError("events");
+                SDL_InvalidParamError("events");
+                return -1;
             }
             for (i = 0; i < numevents; ++i) {
                 used += SDL_AddEvent(&events[i]);