Improve cortex_m3 command argument parsing.
authorZachary T Welch <zw@superlucidity.net>
Sat, 24 Oct 2009 13:36:06 +0000 (06:36 -0700)
committerZachary T Welch <zw@superlucidity.net>
Fri, 6 Nov 2009 02:03:19 +0000 (18:03 -0800)
src/target/cortex_m3.c

index 51481a9..a1d1cbc 100644 (file)
@@ -1830,14 +1830,10 @@ handle_cortex_m3_disassemble_command(struct command_context_s *cmd_ctx,
        errno = 0;
        switch (argc) {
        case 2:
-               count = strtoul(args[1], NULL, 0);
-               if (errno)
-                       return ERROR_FAIL;
+               COMMAND_PARSE_NUMBER(ulong, args[1], count);
                /* FALL THROUGH */
        case 1:
-               address = strtoul(args[0], NULL, 0);
-               if (errno)
-                       return ERROR_FAIL;
+               COMMAND_PARSE_NUMBER(u32, args[0], address);
                break;
        default:
                command_print(cmd_ctx,