test/testrumble.c
changeset 11416 7e7d8a125d6a
parent 10737 3406a0f8b041
child 11811 5d94cb6b24d3
     1.1 --- a/test/testrumble.c	Tue Aug 29 09:02:04 2017 -0700
     1.2 +++ b/test/testrumble.c	Tue Aug 29 15:52:49 2017 -0400
     1.3 @@ -54,6 +54,7 @@
     1.4      name = NULL;
     1.5      index = -1;
     1.6      if (argc > 1) {
     1.7 +        size_t l;
     1.8          name = argv[1];
     1.9          if ((strcmp(name, "--help") == 0) || (strcmp(name, "-h") == 0)) {
    1.10              SDL_Log("USAGE: %s [device]\n"
    1.11 @@ -63,9 +64,9 @@
    1.12              return 0;
    1.13          }
    1.14  
    1.15 -        i = strlen(name);
    1.16 -        if ((i < 3) && isdigit(name[0]) && ((i == 1) || isdigit(name[1]))) {
    1.17 -            index = atoi(name);
    1.18 +        l = SDL_strlen(name);
    1.19 +        if ((l < 3) && SDL_isdigit(name[0]) && ((l == 1) || SDL_isdigit(name[1]))) {
    1.20 +            index = SDL_atoi(name);
    1.21              name = NULL;
    1.22          }
    1.23      }