*** VERSION 5.1.0 ***
[NeonServV5.git] / src / modcmd.c
index ac3e400fc13e50758c2b04841fa9f50168e24abd..eeaee94974644a18764c2aca0a1b69a7d82dddaa 100644 (file)
@@ -1,4 +1,4 @@
-/* modcmd.c - NeonServ v5.0
+/* modcmd.c - NeonServ v5.1
  * Copyright (C) 2011  Philipp Kreil (pk910)
  * 
  * This program is free software: you can redistribute it and/or modify
@@ -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);