mw_debug: use isxdigit for hex arguments
authorMatt Johnston <matt@codeconstruct.com.au>
Fri, 4 Feb 2022 04:08:07 +0000 (12:08 +0800)
committerMatt Johnston <matt@codeconstruct.com.au>
Fri, 4 Feb 2022 08:09:28 +0000 (16:09 +0800)
Signed-off-by: Matt Johnston <matt@codeconstruct.com.au>
scripts/mw_debug/mw_debug.c

index 4a7f6e18f177f2b977bac063857204efe1c60371..1f7688b8fd24e3850be394ead2098f10d7901ca3 100644 (file)
@@ -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) {