diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/libinput-util.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/libinput-util.h b/src/libinput-util.h index 6c9afdc1..a42643d3 100644 --- a/src/libinput-util.h +++ b/src/libinput-util.h @@ -28,6 +28,7 @@ #include "config.h" #include <assert.h> +#include <errno.h> #include <limits.h> #include <math.h> #include <stdarg.h> @@ -410,7 +411,10 @@ safe_atoi(const char *str, int *val) char *endptr; long v; + errno = 0; v = strtol(str, &endptr, 10); + if (errno > 0) + return false; if (str == endptr) return false; if (*str != '\0' && *endptr != '\0') |