From 8ff37ec010ee228c0f7627b43e225103d9f460db Mon Sep 17 00:00:00 2001 From: Heinrich Schuchardt Date: Sun, 3 Nov 2024 23:42:20 +0100 Subject: lib: provide function hextoull() We often convert hexadecimal strings to hextoull(). Provide a wrapper function to simple_strtoull() that does not require specifying the radix. Signed-off-by: Heinrich Schuchardt Reviewed-by: Patrick Delaunay Reviewed-by: Ilias Apalodimas --- lib/strto.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib/strto.c') diff --git a/lib/strto.c b/lib/strto.c index f83ac67c666..206d1e91847 100644 --- a/lib/strto.c +++ b/lib/strto.c @@ -78,6 +78,11 @@ ulong hextoul(const char *cp, char **endp) return simple_strtoul(cp, endp, 16); } +unsigned long long hextoull(const char *cp, char **endp) +{ + return simple_strtoull(cp, endp, 16); +} + ulong dectoul(const char *cp, char **endp) { return simple_strtoul(cp, endp, 10); -- cgit v1.2.3