diff --git a/source/shell/flash.c b/source/shell/flash.c index 410a49a..6211ad1 100644 --- a/source/shell/flash.c +++ b/source/shell/flash.c @@ -127,17 +127,17 @@ static int do_flash_read(struct console *con, size_t argc, const char **argv) return -1; } - addr = strtoull(argv[0], NULL, 16); + addr = strtoull(argv[0], NULL, 0); if (errno == EINVAL || errno == ERANGE) { - fprintf(con->fp, "error: expected hexadecimal value for addr\n"); + fprintf(con->fp, "error: expected integer value for addr\n"); return -1; } - len = strtoull(argv[1], NULL, 16); + len = strtoull(argv[1], NULL, 0); if (errno == EINVAL || errno == ERANGE) { - fprintf(con->fp, "error: expected hexadecimal value for len\n"); + fprintf(con->fp, "error: expected integer value for len\n"); return -1; } @@ -171,17 +171,17 @@ static int do_flash_write(struct console *con, size_t argc, const char **argv) return -1; } - addr = strtoull(argv[0], NULL, 16); + addr = strtoull(argv[0], NULL, 0); if (errno == EINVAL || errno == ERANGE) { - fprintf(con->fp, "error: expected hexadecimal value for addr\n"); + fprintf(con->fp, "error: expected integer value for addr\n"); return -1; } - len = strtoull(argv[1], NULL, 16); + len = strtoull(argv[1], NULL, 0); if (errno == EINVAL || errno == ERANGE) { - fprintf(con->fp, "error: expected hexadecimal value for len\n"); + fprintf(con->fp, "error: expected integer value for len\n"); return -1; } @@ -219,17 +219,17 @@ static int do_flash_erase(struct console *con, size_t argc, const char **argv) return -1; } - addr = strtoull(argv[0], NULL, 16); + addr = strtoull(argv[0], NULL, 0); if (errno == EINVAL || errno == ERANGE) { - fprintf(con->fp, "error: expected hexadecimal value for addr\n"); + fprintf(con->fp, "error: expected integer value for addr\n"); return -1; } - len = strtoull(argv[1], NULL, 16); + len = strtoull(argv[1], NULL, 0); if (errno == EINVAL || errno == ERANGE) { - fprintf(con->fp, "error: expected hexadecimal value for len\n"); + fprintf(con->fp, "error: expected integer value for len\n"); return -1; }