From 26fe379e4ed7b32084fd7b3026a713b8e26f2e29 Mon Sep 17 00:00:00 2001 From: bui Date: Tue, 17 Oct 2017 17:56:01 +0200 Subject: do the strtol dance to make jvoisin happy --- src/sp_config_keywords.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index 1f48852..b2e83fe 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c @@ -237,7 +237,14 @@ int parse_disabled_functions(char *line) { } if (pos) { - df->pos = atoi(pos) > 128 ? 128: atoi(pos); // FIXME do the strtol dance + errno = 0; + df->pos = strtol(pos, NULL, 10) > 128 ? 128 : strtol(pos, NULL, 10); + if (errno != 0) { + sp_log_err("config", + "Failed to parse arg '%s' of `pos` on line %zu.", + pos, sp_line_no); + return -1; + } } if (df->function) { -- cgit v1.3