fixed finsh_var_delete issue which is found by Grissiom.

git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2103 bbd45198-f89e-11dd-88c7-29a3b14d5316
This commit is contained in:
bernard.xiong@gmail.com 2012-04-26 22:15:27 +00:00
parent 09592b5df8
commit 3ac2f2b094
1 changed files with 3 additions and 1 deletions

View File

@ -10,6 +10,8 @@
* Change Logs:
* Date Author Notes
* 2010-03-22 Bernard first version
* 2012-04-27 Bernard fixed finsh_var_delete issue which
* is found by Grissiom.
*/
#include <finsh.h>
#include "finsh_var.h"
@ -58,7 +60,7 @@ int finsh_var_delete(const char* name)
for (i = 0; i < FINSH_VARIABLE_MAX; i ++)
{
if (strncpy(global_variable[i].name, name, FINSH_NAME_MAX) == 0)
if (strncmp(global_variable[i].name, name, FINSH_NAME_MAX) == 0)
break;
}