From 43f39913980b85a400f6b20648708372d2c71739 Mon Sep 17 00:00:00 2001 From: Petar Popovic Date: Sat, 9 Aug 2025 18:00:04 +0200 Subject: [PATCH] linux/SDL_syshaptic.c:SDL_SYS_HapticStopAll(): Fix return on error --- src/haptic/linux/SDL_syshaptic.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/haptic/linux/SDL_syshaptic.c b/src/haptic/linux/SDL_syshaptic.c index 842f577cfa..fa49e457bd 100644 --- a/src/haptic/linux/SDL_syshaptic.c +++ b/src/haptic/linux/SDL_syshaptic.c @@ -1117,13 +1117,12 @@ bool SDL_SYS_HapticResume(SDL_Haptic *haptic) */ bool SDL_SYS_HapticStopAll(SDL_Haptic *haptic) { - int i, ret; + int i; // Linux does not support this natively so we have to loop. for (i = 0; i < haptic->neffects; i++) { if (haptic->effects[i].hweffect != NULL) { - ret = SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i]); - if (ret < 0) { + if (!SDL_SYS_HapticStopEffect(haptic, &haptic->effects[i])) { return SDL_SetError("Haptic: Error while trying to stop all playing effects."); } }