From ce51632a357d347737bf40d3817df331cd8874cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Thu, 9 Apr 2020 11:18:26 +0200 Subject: basic/parse-util: add safe_atoux64() --- src/basic/parse-util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/basic/parse-util.c') diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c index e0094b0f37..8de5cd5c56 100644 --- a/src/basic/parse-util.c +++ b/src/basic/parse-util.c @@ -395,7 +395,7 @@ int safe_atoi(const char *s, int *ret_i) { return 0; } -int safe_atollu(const char *s, long long unsigned *ret_llu) { +int safe_atollu_full(const char *s, unsigned base, long long unsigned *ret_llu) { char *x = NULL; unsigned long long l; @@ -404,7 +404,7 @@ int safe_atollu(const char *s, long long unsigned *ret_llu) { s += strspn(s, WHITESPACE); errno = 0; - l = strtoull(s, &x, 0); + l = strtoull(s, &x, base); if (errno > 0) return -errno; if (!x || x == s || *x != 0) -- cgit v1.2.1