summaryrefslogtreecommitdiffstats
path: root/polyp/conf-parser.c
diff options
context:
space:
mode:
Diffstat (limited to 'polyp/conf-parser.c')
-rw-r--r--polyp/conf-parser.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/polyp/conf-parser.c b/polyp/conf-parser.c
index 35c4766e..b25508e2 100644
--- a/polyp/conf-parser.c
+++ b/polyp/conf-parser.c
@@ -135,17 +135,16 @@ finish:
}
int pa_config_parse_int(const char *filename, unsigned line, const char *lvalue, const char *rvalue, void *data, void *userdata) {
- int *i = data, k;
- char *x = NULL;
+ int *i = data;
+ int32_t k;
assert(filename && lvalue && rvalue && data);
-
- k = strtol(rvalue, &x, 0);
- if (!*rvalue || !x || *x) {
+
+ if (pa_atoi(rvalue, &k) < 0) {
pa_log(__FILE__": [%s:%u] Failed to parse numeric value: %s\n", filename, line, rvalue);
return -1;
}
- *i = k;
+ *i = (int) k;
return 0;
}