summaryrefslogtreecommitdiff
path: root/lib/strto.c
diff options
context:
space:
mode:
authorHeinrich Schuchardt <heinrich.schuchardt@canonical.com>2024-11-03 23:42:20 +0100
committerTom Rini <trini@konsulko.com>2024-11-13 08:14:23 -0600
commit8ff37ec010ee228c0f7627b43e225103d9f460db (patch)
tree90806f53aa4442ab5f94d6b1878240a7a8345a5c /lib/strto.c
parente2635570e08199bb5644ce164def2a46d1dee9c0 (diff)
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 <heinrich.schuchardt@canonical.com> Reviewed-by: Patrick Delaunay <patrick.delaunay@foss.st.com> Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Diffstat (limited to 'lib/strto.c')
-rw-r--r--lib/strto.c5
1 files changed, 5 insertions, 0 deletions
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);