summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbui2017-10-17 17:56:01 +0200
committerjvoisin2017-10-18 15:27:21 +0200
commit26fe379e4ed7b32084fd7b3026a713b8e26f2e29 (patch)
tree6d665f80729826b215360bd3b8ef6f7a77454d23
parentfe43991e3dc6c46e2781d21369f5e268de7baef9 (diff)
do the strtol dance to make jvoisin happy
-rw-r--r--src/sp_config_keywords.c9
1 files changed, 8 insertions, 1 deletions
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) {
237 } 237 }
238 238
239 if (pos) { 239 if (pos) {
240 df->pos = atoi(pos) > 128 ? 128: atoi(pos); // FIXME do the strtol dance 240 errno = 0;
241 df->pos = strtol(pos, NULL, 10) > 128 ? 128 : strtol(pos, NULL, 10);
242 if (errno != 0) {
243 sp_log_err("config",
244 "Failed to parse arg '%s' of `pos` on line %zu.",
245 pos, sp_line_no);
246 return -1;
247 }
241 } 248 }
242 249
243 if (df->function) { 250 if (df->function) {