From: Matt Johnston Date: Fri, 4 Feb 2022 04:08:07 +0000 (+0800) Subject: mw_debug: use isxdigit for hex arguments X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=763138798e8b26ed5a0921faafadfa9919a5bf58;p=microwatt.git mw_debug: use isxdigit for hex arguments Signed-off-by: Matt Johnston --- diff --git a/scripts/mw_debug/mw_debug.c b/scripts/mw_debug/mw_debug.c index 4a7f6e1..1f7688b 100644 --- a/scripts/mw_debug/mw_debug.c +++ b/scripts/mw_debug/mw_debug.c @@ -817,7 +817,7 @@ int main(int argc, char *argv[]) if ((i+1) >= argc) usage(argv[0]); addr = strtoul(argv[++i], NULL, 16); - if (((i+1) < argc) && isdigit(argv[i+1][0])) + if (((i+1) < argc) && isxdigit(argv[i+1][0])) count = strtoul(argv[++i], NULL, 16); mem_read(addr, count); } else if (strcmp(argv[i], "mw") == 0) { @@ -835,7 +835,7 @@ int main(int argc, char *argv[]) if ((i+1) >= argc) usage(argv[0]); filename = argv[++i]; - if (((i+1) < argc) && isdigit(argv[i+1][0])) + if (((i+1) < argc) && isxdigit(argv[i+1][0])) addr = strtoul(argv[++i], NULL, 16); load(filename, addr); } else if (strcmp(argv[i], "save") == 0) {