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 +#include #include #include #include @@ -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')