Merge branch 'development'
[NeonServV5.git] / src / modules / NeonServ.mod / cmd_neonserv_mode.c
index a1a912524f10c82ef04021aa20ff93600bcd7f32..d153ffa53757f847287afd77f10a692a3411d336 100644 (file)
@@ -92,6 +92,7 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
     arg = 0;
     while(arg < argc) {
         char *modeStr = argv[arg++];
+        char modeStrBuf[3];
         for(i = 0; i < strlen(modeStr); i++) {
             switch(modeStr[i]) {
                 case '+':
@@ -103,7 +104,8 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                 case 'o':
                 case 'v':
                     if(arg == argc) {
-                        reply(textclient, user, "NS_MODE_INVALID", modeStr[i]);
+                        sprintf(modeStrBuf, "%c%c", (add ? '+' : '-'), modeStr[i]);
+                        reply(textclient, user, "NS_MODE_INVALID", modeStrBuf);
                         return;
                     }
                     carg = argv[arg++];
@@ -152,7 +154,8 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                     break;
                 case 'b':
                     if(arg == argc) {
-                        reply(textclient, user, "NS_MODE_INVALID", modeStr[i]);
+                        sprintf(modeStrBuf, "%c%c", (add ? '+' : '-'), modeStr[i]);
+                        reply(textclient, user, "NS_MODE_INVALID", modeStrBuf);
                         return;
                     }
                     carg = argv[arg++];
@@ -206,7 +209,8 @@ static void neonserv_cmd_mode_async1(struct ClientSocket *client, struct ClientS
                 default:
                     modetype = getModeType(modelock, modeStr[i]);
                     if(modetype == 0) {
-                        reply(textclient, user, "NS_MODE_INVALID", modeStr);
+                        sprintf(modeStrBuf, "%c%c", (add ? '+' : '-'), modeStr[i]);
+                        reply(textclient, user, "NS_MODE_INVALID", modeStrBuf);
                         return;
                     }
                     if(isModeAffected(modelock, modeStr[i]) && add == !isModeSet(modelock, modeStr[i]) && uaccess < db_enfmodes) {