SDL: thread: return -1 from SDL_SemWaitTimeout if semaphore is NULL

From f6db1aba664079e63df44cbb6e6925a088b8f3a8 Mon Sep 17 00:00:00 2001
From: pionere <[EMAIL REDACTED]>
Date: Tue, 29 Nov 2022 09:46:20 +0100
Subject: [PATCH] thread: return -1 from SDL_SemWaitTimeout if semaphore is
 NULL

---
 src/thread/ps2/SDL_syssem.c  | 3 +--
 src/thread/psp/SDL_syssem.c  | 3 +--
 src/thread/vita/SDL_syssem.c | 3 +--
 3 files changed, 3 insertions(+), 6 deletions(-)

diff --git a/src/thread/ps2/SDL_syssem.c b/src/thread/ps2/SDL_syssem.c
index 37b7f7395375..fab72c14f850 100644
--- a/src/thread/ps2/SDL_syssem.c
+++ b/src/thread/ps2/SDL_syssem.c
@@ -85,8 +85,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
     InitializeTimerAlarm(&alarm);
     
     if (sem == NULL) {
-        SDL_InvalidParamError("sem");
-        return 0;
+        return SDL_InvalidParamError("sem");
     }
 
     if (timeout == 0) {
diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c
index 9850004039df..91c6caa9b768 100644
--- a/src/thread/psp/SDL_syssem.c
+++ b/src/thread/psp/SDL_syssem.c
@@ -80,8 +80,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
     int res;
 
     if (sem == NULL) {
-        SDL_InvalidParamError("sem");
-        return 0;
+        return SDL_InvalidParamError("sem");
     }
 
     if (timeout == 0) {
diff --git a/src/thread/vita/SDL_syssem.c b/src/thread/vita/SDL_syssem.c
index 2609a4ce8d82..5867b60f1177 100644
--- a/src/thread/vita/SDL_syssem.c
+++ b/src/thread/vita/SDL_syssem.c
@@ -81,8 +81,7 @@ int SDL_SemWaitTimeout(SDL_sem *sem, Uint32 timeout)
        unsigned int res;
 
     if (sem == NULL) {
-        SDL_InvalidParamError("sem");
-        return 0;
+        return SDL_InvalidParamError("sem");
     }
 
     if (timeout == 0) {