From: pk910 Date: Mon, 15 Aug 2011 04:08:00 +0000 (+0200) Subject: fixed last commit #2 X-Git-Tag: v5.3~545 X-Git-Url: http://git.pk910.de/?p=NeonServV5.git;a=commitdiff_plain;h=010d5f759019573fcec7ef8b96ee0920963eb5ee fixed last commit #2 --- 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; }