src/events/SDL_mouse.c
changeset 10676 5c4eaca2517a
parent 10674 120c2e96b094
child 10737 3406a0f8b041
     1.1 --- a/src/events/SDL_mouse.c	Sat Dec 03 00:40:13 2016 -0800
     1.2 +++ b/src/events/SDL_mouse.c	Sat Dec 03 09:59:43 2016 -0800
     1.3 @@ -45,7 +45,11 @@
     1.4  {
     1.5      SDL_Mouse *mouse = (SDL_Mouse *)userdata;
     1.6  
     1.7 -    mouse->normal_speed_scale = (float)SDL_atof(hint);
     1.8 +    if (hint && *hint) {
     1.9 +        mouse->normal_speed_scale = (float)SDL_atof(hint);
    1.10 +    } else {
    1.11 +        mouse->normal_speed_scale = 1.0f;
    1.12 +    }
    1.13  }
    1.14  
    1.15  static void
    1.16 @@ -53,7 +57,11 @@
    1.17  {
    1.18      SDL_Mouse *mouse = (SDL_Mouse *)userdata;
    1.19  
    1.20 -    mouse->relative_speed_scale = (float)SDL_atof(hint);
    1.21 +    if (hint && *hint) {
    1.22 +        mouse->relative_speed_scale = (float)SDL_atof(hint);
    1.23 +    } else {
    1.24 +        mouse->relative_speed_scale = 1.0f;
    1.25 +    }
    1.26  }
    1.27  
    1.28  /* Public functions */