From d41bf46c1a541c663bfa5080c683240238f56845 Mon Sep 17 00:00:00 2001 From: Gabriel Ravier Date: Sun, 12 Apr 2020 01:04:23 +0200 Subject: [PATCH] Backends/SDL2/Controller: `x` -> `x != NULL` and removed unnecessary braces Signed-off-by: Gabriel Ravier --- src/Backends/SDL2/Controller.cpp | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/Backends/SDL2/Controller.cpp b/src/Backends/SDL2/Controller.cpp index e710a167..a485431f 100644 --- a/src/Backends/SDL2/Controller.cpp +++ b/src/Backends/SDL2/Controller.cpp @@ -172,15 +172,11 @@ void ControllerBackend_JoystickConnect(Sint32 joystick_id) // Set up neutral axes axis_neutrals = (Sint16*)malloc(sizeof(Sint16) * total_axes); - if (axis_neutrals) - { + if (axis_neutrals != NULL) for (int i = 0; i < total_axes; ++i) axis_neutrals[i] = SDL_JoystickGetAxis(joystick, i); - } else - { Backend_PrintError("Couldn't allocate memory for neutral axes"); - } } else {