module-rt{kit}: use spa_atoi32 instead of custom strtol

And duplicate the function into rtkit which had a similar but different
approach to it. Let's get both to do the same here.
This commit is contained in:
Peter Hutterer 2021-10-12 13:14:24 +10:00 committed by Wim Taymans
parent 87a1e1534c
commit 696a4b22e9
2 changed files with 12 additions and 7 deletions

View file

@ -150,10 +150,7 @@ static int get_default_int(struct pw_properties *properties, const char *name, i
bool set_default = true;
if ((str = pw_properties_get(properties, name)) != NULL) {
char *endptr;
val = (int)strtol(str, &endptr, 10);
if (*endptr == '\0')
if (spa_atoi32(str, &val, 10))
set_default = false;
else
pw_log_warn("invalid integer value '%s' of property %s, using default (%d) instead", str, name, def);