From 812f5f9bc5a5215c6f84ab0f6949b20a064e465f Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Tue, 11 Dec 2012 16:53:59 -0500 Subject: [PATCH] Patched testjoystick.c to compile. --- test/testjoystick.c | 8 ++++---- 1 file 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); } }