Document that you can pass NULL to SDL_PeepEvents()

Fixes https://github.com/libsdl-org/sdlwiki/issues/547
This commit is contained in:
Sam Lantinga committed 2024-06-06 10:08:20 -07:00
1 parent 7547d80c05
commit 23db1062fc
2 files changed
+9 -5

No files matched your search

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