Patched testjoystick.c to compile.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 11 Dec 2012 16:53:59 -0500
changeset 6747 b617821795bf
parent 6746 1ae364ea5112
child 6748 80a6aac67ad9
Patched testjoystick.c to compile.
test/testjoystick.c
--- a/test/testjoystick.c	Tue Dec 11 16:53:38 2012 -0500
+++ b/test/testjoystick.c	Tue Dec 11 16:53:59 2012 -0500
@@ -219,15 +219,15 @@
             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);
         }
     }