aboutsummaryrefslogtreecommitdiff
path: root/src/player.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/player.c')
-rw-r--r--src/player.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/player.c b/src/player.c
index 20c2570..3a4757e 100644
--- a/src/player.c
+++ b/src/player.c
@@ -66,12 +66,10 @@ static bool remove_gamepad(struct pw_players *players,
bool pw_players_event(struct pw_players *players, SDL_Event *event) {
if (!players) {
- SDL_InvalidParamError("players");
- return false;
+ return SDL_InvalidParamError("players");
}
if (!event) {
- SDL_InvalidParamError("event");
- return false;
+ return SDL_InvalidParamError("event");
}
switch (event->type) {
@@ -85,6 +83,11 @@ bool pw_players_event(struct pw_players *players, SDL_Event *event) {
}
size_t pw_players_count(struct pw_players *players) {
+ if (!players) {
+ SDL_InvalidParamError("players");
+ return 0;
+ }
+
size_t count = 0;
for (size_t i = 0; i < PW_PLAYERS_MAX; i++) {
if (players->gamepads[i]) {