shithub: cstory

Download patch

ref: d41bf46c1a541c663bfa5080c683240238f56845
parent: d870805068eddba3b067a9d3ab322549390f06f7
author: Gabriel Ravier <gabravier@gmail.com>
date: Sat Apr 11 21:04:23 EDT 2020

Backends/SDL2/Controller: `x` -> `x != NULL` and removed unnecessary braces

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>

--- a/src/Backends/SDL2/Controller.cpp
+++ b/src/Backends/SDL2/Controller.cpp
@@ -172,15 +172,11 @@
 
 				// 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
 			{