summaryrefslogtreecommitdiff
path: root/components
diff options
context:
space:
mode:
author[email protected] <[email protected]>2012-04-26 22:15:27 +0000
committer[email protected] <[email protected]>2012-04-26 22:15:27 +0000
commit3ac2f2b0949caa62ec45d188cf4cc62ce8f2b7a3 (patch)
tree9fd5f205b4419a1e594e47760db5401c5c01c49f /components
parent09592b5df8b42f97b7688e4c33d8eca0376d8014 (diff)
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
Diffstat (limited to 'components')
-rw-r--r--components/finsh/finsh_var.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/components/finsh/finsh_var.c b/components/finsh/finsh_var.c
index 7d8cde709a..96f1244210 100644
--- a/components/finsh/finsh_var.c
+++ b/components/finsh/finsh_var.c
@@ -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;
}