Change the stro{,u}{l,ll} base parameter to 0 to not disallow hex or
octal numbers, useful for bitmasks.
---
ell/settings.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/ell/settings.c b/ell/settings.c
index c5e1184..f4326d6 100644
--- a/ell/settings.c
+++ b/ell/settings.c
@@ -998,7 +998,7 @@ LIB_EXPORT bool l_settings_get_int(const struct l_settings *settings,
errno = 0;
- t = r = strtol(value, &endp, 10);
+ t = r = strtol(value, &endp, 0);
if (*endp != '\0')
goto error;
@@ -1045,7 +1045,7 @@ LIB_EXPORT bool l_settings_get_uint(const struct l_settings
*settings,
errno = 0;
- t = r = strtoul(value, &endp, 10);
+ t = r = strtoul(value, &endp, 0);
if (*endp != '\0')
goto error;
@@ -1091,7 +1091,7 @@ LIB_EXPORT bool l_settings_get_int64(const struct l_settings
*settings,
errno = 0;
- r = strtoll(value, &endp, 10);
+ r = strtoll(value, &endp, 0);
if (*endp != '\0')
goto error;
@@ -1137,7 +1137,7 @@ LIB_EXPORT bool l_settings_get_uint64(const struct l_settings
*settings,
errno = 0;
- r = strtoull(value, &endp, 10);
+ r = strtoull(value, &endp, 0);
if (*endp != '\0')
goto error;
--
2.20.1
Show replies by date
hi Andrew,
On 3/25/20 3:18 PM, Andrew Zaborowski wrote:
Change the stro{,u}{l,ll} base parameter to 0 to not disallow hex or
octal numbers, useful for bitmasks.
---
ell/settings.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
Applied, thanks.
Regards,
-Denis