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

Signed-off-by: Gabriel Ravier <gabravier@gmail.com>
This commit is contained in:
Gabriel Ravier 2020-04-12 01:04:23 +02:00
parent d870805068
commit d41bf46c1a

View file

@ -172,16 +172,12 @@ 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
{
SDL_JoystickClose(joystick);