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 <adrian.warecki@intel.com>
This commit is contained in:
Adrian Warecki 2023-02-27 09:57:06 +01:00 committed by pjdobrowolski
parent 5ebbd6530c
commit a4ca53c9f1
1 changed files with 1 additions and 1 deletions

View File

@ -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 */