From: Erik M. <er...@us...> - 2001-12-19 19:03:48
|
Update of /cvsroot/blob/blob/src/lib In directory usw-pr-cvs1:/tmp/cvs-serv14312/src/lib Modified Files: command.c Log Message: Remove strncmp(). This will force you to think before you compare two strings, but I consider that a Good Thing [tm]. All other changes are trivial. Index: command.c =================================================================== RCS file: /cvsroot/blob/blob/src/lib/command.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- command.c 2001/10/31 16:42:03 1.7 +++ command.c 2001/12/19 19:03:45 1.8 @@ -229,7 +229,8 @@ /* help on a command? */ if(argc >= 2) { for(cmd = commands; cmd != NULL; cmd = cmd->next) { - if(strcmp(cmd->name, argv[1]) == 0) { + if(strncmp(cmd->name, argv[1], + MAX_COMMANDLINE_LENGTH) == 0) { SerialOutputString("Help for '"); SerialOutputString(argv[1]); SerialOutputString("':\n\nUsage: "); |