From a4ca53c9f164501e821d396768c3df98cc5ee5fd Mon Sep 17 00:00:00 2001 From: Adrian Warecki Date: Mon, 27 Feb 2023 09:57:06 +0100 Subject: [PATCH] toml_utils: Adding support for decimal numbers in hex parser Modified the strtoul function parameter to automatically recognize the value format. This will avoid the situation when a decimal value is parsed as hexadecimal. Signed-off-by: Adrian Warecki --- src/toml_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/toml_utils.c b/src/toml_utils.c index 85567f3d8..128286d71 100644 --- a/src/toml_utils.c +++ b/src/toml_utils.c @@ -150,7 +150,7 @@ uint32_t parse_uint32_hex_key(const toml_table_t *table, struct parse_ctx *ctx, *error = err_key_parse(key, NULL); return UINT32_MAX; } - val = strtoul(temp_s, 0, 16); + val = strtoul(temp_s, 0, 0); free(temp_s); /* assert parsing success and value is within uint32_t range */