From 8876637c9f41c65d69b599f7811024da80554cc6 Mon Sep 17 00:00:00 2001 From: Maarten ter Huurne Date: Wed, 27 Aug 2008 09:54:11 +0000 Subject: [PATCH] Fixed invalid use of sprintf. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@344 8ced0084-cf51-0410-be5f-012b33b47a6e --- .../Plugin_nJoy_SDL/Src/GUI/ConfigBox.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) 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))