diff options
author | Simon Howard | 2014-04-01 20:56:33 -0400 |
---|---|---|
committer | Simon Howard | 2014-04-01 20:56:33 -0400 |
commit | 17c14e1fad6dc277a6e58e4f421d5c65e210d1fe (patch) | |
tree | fab7248ca23ce615c62222377a3ff5cab6bbeb73 /src/setup/txt_joybinput.c | |
parent | 8eb3200286d523379295143ce3f44d77ce036d4b (diff) | |
download | chocolate-doom-17c14e1fad6dc277a6e58e4f421d5c65e210d1fe.tar.gz chocolate-doom-17c14e1fad6dc277a6e58e4f421d5c65e210d1fe.tar.bz2 chocolate-doom-17c14e1fad6dc277a6e58e4f421d5c65e210d1fe.zip |
setup: Eliminate use of sprintf().
Use M_snprintf() or M_StringJoin() instead where appropriate.
This fixes #371.
Diffstat (limited to 'src/setup/txt_joybinput.c')
-rw-r--r-- | src/setup/txt_joybinput.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/setup/txt_joybinput.c b/src/setup/txt_joybinput.c index ce466d50..4e41f3fd 100644 --- a/src/setup/txt_joybinput.c +++ b/src/setup/txt_joybinput.c @@ -125,9 +125,9 @@ static void TXT_JoystickInputSizeCalc(TXT_UNCAST_ARG(joystick_input)) joystick_input->widget.h = 1; } -static void GetJoystickButtonDescription(int button, char *buf) +static void GetJoystickButtonDescription(int button, char *buf, size_t buf_len) { - sprintf(buf, "BUTTON #%i", button + 1); + M_snprintf(buf, buf_len, "BUTTON #%i", button + 1); } static void TXT_JoystickInputDrawer(TXT_UNCAST_ARG(joystick_input)) @@ -142,7 +142,8 @@ static void TXT_JoystickInputDrawer(TXT_UNCAST_ARG(joystick_input)) } else { - GetJoystickButtonDescription(*joystick_input->variable, buf); + GetJoystickButtonDescription(*joystick_input->variable, + buf, sizeof(buf)); } TXT_SetWidgetBG(joystick_input); |