diff --git a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp index 2f5b2b2318..ab3b8d8e8d 100644 --- a/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp +++ b/Source/Plugins/Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp @@ -623,11 +623,7 @@ void ConfigBox::GetButtons(wxCommandEvent& event) SLEEP(10); } - if(succeed) - sprintf(format, "%d", pressed); - else - sprintf(format, "-1", pressed); - + sprintf(format, "%d", succeed ? pressed : -1); SetButtonText(ID, format); if(SDL_JoystickOpened(joysticks[controller].ID)) @@ -686,10 +682,7 @@ void ConfigBox::GetHats(int ID) SLEEP(10); } - if(succeed) - sprintf(format, "%d", pressed); - else - sprintf(format, "-1", pressed); + sprintf(format, "%d", succeed ? pressed : -1); SetButtonText(ID, format); if(SDL_JoystickOpened(joysticks[controller].ID)) @@ -751,10 +744,7 @@ void ConfigBox::GetAxis(wxCommandEvent& event) SLEEP(10); } - if(succeed) - sprintf(format, "%d", pressed); - else - sprintf(format, "-1", pressed); + sprintf(format, "%d", succeed ? pressed : -1); SetButtonText(ID, format); if(SDL_JoystickOpened(joysticks[controller].ID))