[Sheepdog] [PATCH] collie: fix comparison of command names

MORITA Kazutaka morita.kazutaka at lab.ntt.co.jp
Thu Aug 4 19:47:54 CEST 2011


Signed-off-by: MORITA Kazutaka <morita.kazutaka at lab.ntt.co.jp>
---
 collie/collie.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/collie/collie.c b/collie/collie.c
index a89359a..292c64a 100644
--- a/collie/collie.c
+++ b/collie/collie.c
@@ -1340,7 +1340,7 @@ static unsigned long setup_command(char *cmd, char *subcmd)
 	unsigned long flags = 0;
 
 	for (i = 0; i < ARRAY_SIZE(commands); i++) {
-		if (!strncmp(commands[i].name, cmd, strlen(commands[i].name))) {
+		if (!strcmp(commands[i].name, cmd)) {
 			found = 1;
 			if (commands[i].parser)
 				command_parser = commands[i].parser;
@@ -1354,7 +1354,7 @@ static unsigned long setup_command(char *cmd, char *subcmd)
 	}
 
 	for (s = commands[i].sub; s->name; s++) {
-		if (!strncmp(s->name, subcmd, strlen(s->name))) {
+		if (!strcmp(s->name, subcmd)) {
 			command_fn = s->fn;
 			command_options = s->opts;
 			command_arg = s->arg;
-- 
1.7.2.5




More information about the sheepdog mailing list