Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fixed crash at startup
  • Loading branch information
slouken committed Dec 3, 2016
1 parent e7efcfb commit 54188c8
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/events/SDL_mouse.c
Expand Up @@ -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 */
Expand Down

0 comments on commit 54188c8

Please sign in to comment.