diff --git a/flash-tool/command_line.c b/flash-tool/command_line.c index aa0e62d..c48a038 100644 --- a/flash-tool/command_line.c +++ b/flash-tool/command_line.c @@ -27,8 +27,10 @@ #include "cmd.h" #include "config.h" +#define MAX_ARGC 10 +#define MAX_ARGV_LENGTH 100 static int com_argc; -static char com_argv[9][100]; +static char com_argv[MAX_ARGC][MAX_ARGV_LENGTH]; static const char COMMAND[][30]= { @@ -132,7 +134,7 @@ int command_interpret(char * com_buf) while ( *(++buf) == ' ' ); com_argv[i][j] = '\0'; i++; - if (i > 9) { + if (i > MAX_ARGC) { printf("\n Para is too much! About!"); return 0; } @@ -141,7 +143,7 @@ int command_interpret(char * com_buf) } else { com_argv[i][j] = *buf; j++; - if (j > 100) { + if (j > MAX_ARGV_LENGTH) { printf("\n Para is too long! About!"); return 0; } diff --git a/flash-tool/usb_boot_defines.h b/flash-tool/usb_boot_defines.h index 17e7b24..7905c2a 100644 --- a/flash-tool/usb_boot_defines.h +++ b/flash-tool/usb_boot_defines.h @@ -146,7 +146,7 @@ struct hand_t { struct fw_args_t fw_args; } __attribute__((packed)); -struct nand_in { +struct nand_in_t { unsigned char dev; unsigned char max_chip; unsigned char *buf; @@ -158,11 +158,11 @@ struct nand_in { int (* check) (unsigned char *,unsigned char *,unsigned int); }; -struct nand_out { +struct nand_out_t { unsigned char *status; }; -struct sdram_in { +struct sdram_in_t { unsigned char dev; unsigned char *buf; unsigned int start;