diff options
| author | bui | 2017-10-17 18:28:36 +0200 |
|---|---|---|
| committer | jvoisin | 2017-10-18 15:27:21 +0200 |
| commit | dbfe7cc04adad832d5b37ff1c6ee45767c7c648f (patch) | |
| tree | 5935144e11c8a8ce2ee454964a90ac2b40f7a1ef | |
| parent | 26fe379e4ed7b32084fd7b3026a713b8e26f2e29 (diff) | |
strtol dance
| -rw-r--r-- | src/sp_config_keywords.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/sp_config_keywords.c b/src/sp_config_keywords.c index b2e83fe..cbdd579 100644 --- a/src/sp_config_keywords.c +++ b/src/sp_config_keywords.c | |||
| @@ -238,8 +238,9 @@ int parse_disabled_functions(char *line) { | |||
| 238 | 238 | ||
| 239 | if (pos) { | 239 | if (pos) { |
| 240 | errno = 0; | 240 | errno = 0; |
| 241 | df->pos = strtol(pos, NULL, 10) > 128 ? 128 : strtol(pos, NULL, 10); | 241 | char *endptr; |
| 242 | if (errno != 0) { | 242 | df->pos = strtol(pos, &endptr, 10) > 128 ? 128 : strtol(pos, NULL, 10); |
| 243 | if (errno != 0 || endptr == pos) { | ||
| 243 | sp_log_err("config", | 244 | sp_log_err("config", |
| 244 | "Failed to parse arg '%s' of `pos` on line %zu.", | 245 | "Failed to parse arg '%s' of `pos` on line %zu.", |
| 245 | pos, sp_line_no); | 246 | pos, sp_line_no); |
