diff options
author | cbdev <cb@cbcdn.com> | 2019-12-18 22:23:34 +0100 |
---|---|---|
committer | cbdev <cb@cbcdn.com> | 2019-12-18 22:23:34 +0100 |
commit | 886c8e299454176446cce82f151b85a82b26aa06 (patch) | |
tree | d479a000e549d223ee333bed676e01b354dfc97c /backends | |
parent | afed3252dd4b3e3372152c7bef8d2b8ed8cb1af4 (diff) | |
download | midimonster-886c8e299454176446cce82f151b85a82b26aa06.tar.gz midimonster-886c8e299454176446cce82f151b85a82b26aa06.tar.bz2 midimonster-886c8e299454176446cce82f151b85a82b26aa06.zip |
Fix evdev division by zero
Diffstat (limited to 'backends')
-rw-r--r-- | backends/evdev.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/backends/evdev.c b/backends/evdev.c index 659dc77..193b28b 100644 --- a/backends/evdev.c +++ b/backends/evdev.c @@ -208,6 +208,9 @@ static int evdev_configure_instance(instance* inst, char* option, char* value) { data->relative_axis[data->relative_axes].max *= -1; data->relative_axis[data->relative_axes].inverted = 1; } + else if(data->relative_axis[data->relative_axes].max == 0){ + fprintf(stderr, "Relative axis configuration for %s.%s has invalid range\n", inst->name, option + 8); + } data->relative_axis[data->relative_axes].current = strtoul(next_token, NULL, 0); if(data->relative_axis[data->relative_axes].code < 0){ fprintf(stderr, "Failed to configure relative axis extents for %s.%s\n", inst->name, option + 8); |