Fix for the previous commit (we should leave one character at the end for the \0 terminator)
This commit is contained in:
parent
5042b7bae4
commit
46a85cd1fb
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ static int init_joystick(void)
|
||||||
for (int cpt; cpt < nr_joysticks; cpt++)
|
for (int cpt; cpt < nr_joysticks; cpt++)
|
||||||
{
|
{
|
||||||
Joysticktable[cpt] = SDL_JoystickOpen(cpt);
|
Joysticktable[cpt] = SDL_JoystickOpen(cpt);
|
||||||
strncpy(JoystickName[cpt], SDL_JoystickName(cpt), sizeof JoystickName[cpt]);
|
strncpy(JoystickName[cpt], SDL_JoystickName(cpt), sizeof JoystickName[cpt] - 1);
|
||||||
printf("Joystick %i : %s\n", cpt, JoystickName[cpt]);
|
printf("Joystick %i : %s\n", cpt, JoystickName[cpt]);
|
||||||
printf(" Buttons: %i Axis: %i Hats: %i\n", SDL_JoystickNumButtons(Joysticktable[cpt]), SDL_JoystickNumAxes(Joysticktable[cpt]), SDL_JoystickNumHats(Joysticktable[cpt]));
|
printf(" Buttons: %i Axis: %i Hats: %i\n", SDL_JoystickNumButtons(Joysticktable[cpt]), SDL_JoystickNumAxes(Joysticktable[cpt]), SDL_JoystickNumHats(Joysticktable[cpt]));
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue