From 763138798e8b26ed5a0921faafadfa9919a5bf58 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Fri, 4 Feb 2022 12:08:07 +0800 Subject: [PATCH] mw_debug: use isxdigit for hex arguments Signed-off-by: Matt Johnston --- scripts/mw_debug/mw_debug.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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) { -- 2.30.2