test/testjoystick.c
changeset 6747 b617821795bf
parent 6736 03dd4a1d06e9
child 6771 55337ff4256f
     1.1 --- a/test/testjoystick.c	Tue Dec 11 16:53:38 2012 -0500
     1.2 +++ b/test/testjoystick.c	Tue Dec 11 16:53:59 2012 -0500
     1.3 @@ -219,15 +219,15 @@
     1.4              fprintf(stderr, "SDL_JoystickOpen(%d) failed: %s\n", i,
     1.5                      SDL_GetError());
     1.6          } else {
     1.7 -            JoystickGUID guid = SDL_JoystickGetGUID(joystick);
     1.8 -            char *guidstr = SDL_JoystickGetGUIDString(guid);
     1.9 +            char guid[64];
    1.10 +            SDL_JoystickGetGUIDString(SDL_JoystickGetGUID(joystick),
    1.11 +                                      guid, sizeof (guid));
    1.12              printf("       axes: %d\n", SDL_JoystickNumAxes(joystick));
    1.13              printf("      balls: %d\n", SDL_JoystickNumBalls(joystick));
    1.14              printf("       hats: %d\n", SDL_JoystickNumHats(joystick));
    1.15              printf("    buttons: %d\n", SDL_JoystickNumButtons(joystick));
    1.16              printf("instance id: %d\n", SDL_JoystickInstanceID(joystick));
    1.17 -            printf("       guid: %s\n", guidstr);
    1.18 -            SDL_free(guidstr);
    1.19 +            printf("       guid: %s\n", guid);
    1.20              SDL_JoystickClose(joystick);
    1.21          }
    1.22      }