syntax fix
[NeonServV5.git] / modcmd.c
index 38f557edddbd1405815f124b70bd0c4250c08c63..a84d5c8ed341c0d3469a0a41a250b97d602a9559 100644 (file)
--- 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,10 +152,10 @@ 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]
+                                    uarga[uargpos++] = argv[argi-1];
                             }
                         } else if(!strcmp(prev_ppos, "c"))
                             uarga[uargpos++] = (chan ? chan->name : NULL);
@@ -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;
                 }