fixed small invalid mode bug with "-k" and a crash bug in event_neonspam_chanmsg.c
[NeonServV5.git] / src / ModeNode.c
index 7dc10f0b68eda98f0434c15a92623961e8581a31..c0fd065e73328b49323b6042e9fb4de71e2e3ac3 100644 (file)
@@ -284,7 +284,7 @@ int parseMode(struct ModeNode* modes, int add, char mode, char *param) {
         modes->modes &= ~modeOpt[0];
         modes->allmodes |= modeOpt[0];
         if(MODE_TYPE == CHANNEL_MODE_TYPE_B) {
-            if(!param) return 0;
+            if(!param && !(modeOpt[2] & CHANNEL_MODE_KEY)) return 0;
             if(MODE_VALUE == CHANNEL_MODE_VALUE_STRING) {
                 free(modes->mode_str_args[MODE_VALUE_INDEX]);
                 modes->mode_str_args[MODE_VALUE_INDEX] = NULL;