From 67448c33f195f266d763f40754824e864f88b8e8 Mon Sep 17 00:00:00 2001 From: Martin Roth Date: Thu, 24 Aug 2023 20:21:09 -0600 Subject: [PATCH] util/kconfig: Allow toada to handle negative integers Any builds using ADA were getting a message saying: `couldn't parse value '-1' for 'SEABIOS_DEBUG_LEVEL'` This change allows toada to parse negative integers. Signed-off-by: Martin Roth Change-Id: I6507c54976b67f1ad70846b6bd6c54c861130d3d Reviewed-on: https://review.coreboot.org/c/coreboot/+/77421 Reviewed-by: Elyes Haouas Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) Reviewed-by: Felix Singer --- util/kconfig/toada.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/util/kconfig/toada.c b/util/kconfig/toada.c index 677aaca815..02b6351c5d 100644 --- a/util/kconfig/toada.c +++ b/util/kconfig/toada.c @@ -103,7 +103,7 @@ int main(int argc, char *argv[]) print_bool(name, true); } else if (strncmp(val, "0x", 2) == 0) { print_hex(name, val + 2); - } else if (isdigit(val[0])) { + } else if (isdigit(val[0]) || (val[0] == '-' && isdigit(val[1]))) { print_dec(name, val); } else { fprintf(stderr,