From 010d5f759019573fcec7ef8b96ee0920963eb5ee Mon Sep 17 00:00:00 2001 From: pk910 Date: Mon, 15 Aug 2011 06:08:00 +0200 Subject: [PATCH] fixed last commit #2 --- modcmd.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/modcmd.c b/modcmd.c index 38f557e..98c9e2e 100644 --- a/modcmd.c +++ b/modcmd.c @@ -80,7 +80,7 @@ static USERAUTH_CALLBACK(command_checked_auth) { execute_cmd = 0; } if(execute_cmd) { - cbind->func->func(cache->client, user, cache->chan, cache->argv, cache->argc); + cache->cbind->func->func(cache->client, user, cache->chan, cache->argv, cache->argc); } free(cache->message); free(cache); @@ -140,8 +140,8 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s int uargpos = 0, argi, allargs = 0; char *ppos = params; char *prev_ppos = params; - while(ppos = strstr(ppos, " ")) { - ppos = '\0'; + while((ppos = strstr(ppos, " "))) { + *ppos = '\0'; if(prev_ppos[0] == '%') { prev_ppos++; if(prev_ppos[strlen(prev_ppos)-1] == '-') { @@ -152,7 +152,7 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s argi = atoi(prev_ppos); if(argi > 0) { if(argi <= argc) continue; - uarga[uargpos++] = argv[argi-1] + uarga[uargpos++] = argv[argi-1]; if(allargs) { for(;argi < argc; argi++) uarga[uargpos++] = argv[argi-1] @@ -164,7 +164,6 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s } else { uarga[uargpos++] = prev_ppos; } - ppos = ' '; ppos++; prev_ppos = ppos; } -- 2.20.1