Switch to use safe_strtoint instead of strtol
Signed-off-by: Bryce Harrington <bryce@osg.samsung.com>
Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/shared/option-parser.c b/shared/option-parser.c
index fb4a342..eee7546 100644
--- a/shared/option-parser.c
+++ b/shared/option-parser.c
@@ -33,6 +33,7 @@
#include <errno.h>
#include "config-parser.h"
+#include "string-helpers.h"
static int
handle_option(const struct weston_option *option, char *value)
@@ -41,9 +42,7 @@
switch (option->type) {
case WESTON_OPTION_INTEGER:
- errno = 0;
- * (int32_t *) option->data = strtol(value, &p, 10);
- if (errno != 0 || p == value || *p != '\0')
+ if (!safe_strtoint(value, option->data))
return 0;
return 1;
case WESTON_OPTION_UNSIGNED_INTEGER: