diff options
author | Ryan C. Gordon <icculus@icculus.org> | 2012-12-11 16:53:59 -0500 |
---|---|---|
committer | Ryan C. Gordon <icculus@icculus.org> | 2012-12-11 16:53:59 -0500 |
commit | b0cb47a2692c8edf7d8b2142c1c076cbdbe8c727 (patch) | |
tree | d8a9455251bf25cfd2322ae3e5b2e9dae9a753a9 /test/testjoystick.c | |
parent | 68a3697823f89003a281ed4f46368516ab56ec03 (diff) | |
download | sdl-b0cb47a2692c8edf7d8b2142c1c076cbdbe8c727.tar.gz |
Patched testjoystick.c to compile.
Diffstat (limited to 'test/testjoystick.c')
-rw-r--r-- | test/testjoystick.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/test/testjoystick.c b/test/testjoystick.c index af99fd53b..74ac476a3 100644 --- a/test/testjoystick.c +++ b/test/testjoystick.c @@ -219,15 +219,15 @@ main(int argc, char *argv[]) fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i, SDL_GetError()); } else { - JoystickGUID guid = SDL_JoystickGetGUID(joystick); - char *guidstr = SDL_JoystickGetGUIDString(guid); + char guid[64]; + SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick), + guid, sizeof (guid)); printf(" axes: %d\n", SDL_JoystickNumAxes(joystick)); printf(" balls: %d\n", SDL_JoystickNumBalls(joystick)); printf(" hats: %d\n", SDL_JoystickNumHats(joystick)); printf(" buttons: %d\n", SDL_JoystickNumButtons(joystick)); printf("instance id: %d\n", SDL_JoystickInstanceID(joystick)); - printf(" guid: %s\n", guidstr); - SDL_free(guidstr); + printf(" guid: %s\n", guid); SDL_JoystickClose(joystick); } } |