Skip to content

Commit

Permalink
Clarify implicit cast to boolean
Browse files Browse the repository at this point in the history
Should not really assume that SDL_JoystickGetAttached() will return a non-zero value as 'true'. Some functions return 0 as 'success'.
  • Loading branch information
Wedge009 committed Sep 25, 2015
1 parent f890564 commit 3546738
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/joystick.cpp
Expand Up @@ -41,7 +41,7 @@ static bool attached(
const std::vector<SDL_Joystick*>& joysticks
, const size_t index)
{
return SDL_JoystickGetAttached(joysticks[index]);
return SDL_JoystickGetAttached(joysticks[index]) == SDL_TRUE;
}

static const char* name(
Expand Down

0 comments on commit 3546738

Please sign in to comment.