fixed modcmd again (small fix)
authorpk910 <philipp@zoelle1.de>
Mon, 3 Oct 2011 18:28:11 +0000 (20:28 +0200)
committerpk910 <philipp@zoelle1.de>
Mon, 3 Oct 2011 18:28:11 +0000 (20:28 +0200)
src/modcmd.c

index ac3e400fc13e50758c2b04841fa9f50168e24abd..c8afed6fec4d02a68d26f43a6eddbe778c4b0909 100644 (file)
@@ -180,10 +180,11 @@ static void handle_command(struct ClientSocket *client, struct UserNode *user, s
                     if(b[0] == '%') {
                         b++;
                         if(b[strlen(b)-1] == '-') {
-                            allargs = 1;
-                            b[strlen(b)-1] = '\0';
+                            allargs = strlen(b)-1;
+                            b[allargs] = '\0';
                             argi = atoi(b);
-                            b[strlen(b)-1] = '-';
+                            b[allargs] = '-';
+                            allargs = 1;
                         } else {
                             allargs = 0;
                             argi = atoi(b);