From: Erik M. <er...@us...> - 2001-10-02 20:50:28
|
Update of /cvsroot/blob/blob/src In directory usw-pr-cvs1:/tmp/cvs-serv23410 Modified Files: command.c Log Message: - Check for the magic value - Remove "test" command Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/command.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- command.c 2001/09/17 00:05:31 1.6 +++ command.c 2001/10/02 20:50:24 1.7 @@ -146,6 +146,15 @@ return 0; for(cmd = commands; cmd != NULL; cmd = cmd->next) { + if(cmd->magic != COMMAND_MAGIC) { + SerialOutputString("*** Command magic failed for 0x"); + SerialOutputHex((u32)cmd); + SerialOutputString("!\n"); + + /* FIXME: should return a proper return value */ + return 0; + } + if(strcmp(cmd->name, cmdline) == 0) { /* call function */ return cmd->callback(argc, argv); @@ -154,36 +163,6 @@ return -1; } - - - - -static int test_command(int argc, char *argv[]) -{ - int i; - - SerialOutputString("*** test_command() got called!\n"); - - SerialOutputString("*** argc = "); - SerialOutputDec(argc); - SerialOutputByte('\n'); - - for(i = 0; i < argc; i++) { - SerialOutputString("*** argv["); - SerialOutputDec(i); - SerialOutputString("] = '"); - SerialOutputString(argv[i]); - SerialOutputString("'\n"); - } - - return 0; -} - - -static char testhelp[] = "test_command\n" -"Test new command line functions\n"; - -__commandlist(test_command, "test", testhelp); |