Skip to content
Permalink
Browse files

Fixed crash at startup

  • Loading branch information
slouken committed Dec 3, 2016
1 parent e7efcfb commit 54188c8b9e5fdaa5056723654184f460812952d4
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/events/SDL_mouse.c
@@ -45,15 +45,23 @@ SDL_MouseNormalSpeedScaleChanged(void *userdata, const char *name, const char *o
{
SDL_Mouse *mouse = (SDL_Mouse *)userdata;

mouse->normal_speed_scale = (float)SDL_atof(hint);
if (hint && *hint) {
mouse->normal_speed_scale = (float)SDL_atof(hint);
} else {
mouse->normal_speed_scale = 1.0f;
}
}

static void
SDL_MouseRelativeSpeedScaleChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
{
SDL_Mouse *mouse = (SDL_Mouse *)userdata;

mouse->relative_speed_scale = (float)SDL_atof(hint);
if (hint && *hint) {
mouse->relative_speed_scale = (float)SDL_atof(hint);
} else {
mouse->relative_speed_scale = 1.0f;
}
}

/* Public functions */

0 comments on commit 54188c8

Please sign in to comment.