Просмотр исходного кода

* Fixed some drunken programming

svn: 2088
Bryan Drewery 21 лет назад
Родитель
Сommit
d99b37ae8a
1 измененных файлов с 5 добавлено и 5 удалено
  1. 5 5
      src/mod/channels.mod/cmdschan.c

+ 5 - 5
src/mod/channels.mod/cmdschan.c

@@ -632,8 +632,7 @@ static void cmd_stick_yn(int idx, char *par, int yn)
 {
 {
   int i = 0, j;
   int i = 0, j;
   struct chanset_t *chan = NULL;
   struct chanset_t *chan = NULL;
-  char *stick_type = NULL, s[UHOSTLEN] = "", chname[81] = "";
-  const char type = 0, *str_type = NULL;
+  char *stick_type = NULL, s[UHOSTLEN] = "", chname[81] = "", type = 0, *str_type = NULL;
   maskrec *channel_list = NULL;
   maskrec *channel_list = NULL;
 
 
   stick_type = newsplit(&par);
   stick_type = newsplit(&par);
@@ -657,17 +656,18 @@ static void cmd_stick_yn(int idx, char *par, int yn)
     }
     }
     type = 'e';
     type = 'e';
     str_type = "exempt";
     str_type = "exempt";
-  } else if (!egg_strcasecmp(stick, type, "invite")) {
+  } else if (!egg_strcasecmp(stick_type, "invite")) {
     if (!use_invites) {
     if (!use_invites) {
       dprintf(idx, "This command can only be used with use-invites enabled.\n");
       dprintf(idx, "This command can only be used with use-invites enabled.\n");
       return;
       return;
     }
     }
     type = 'I';
     type = 'I';
     str_type = "invite";
     str_type = "invite";
-  } else {
+  } else if (!egg_strcasecmp(stick_type, "ban")) {
     type = 'b';
     type = 'b';
     str_type = "ban";
     str_type = "ban";
-  }
+  } else
+    return;
 
 
   if (!chname[0]) {
   if (!chname[0]) {
     channel_list = (type == 'b' ? global_bans : type == 'e' ? global_exempts : global_invites);
     channel_list = (type == 'b' ? global_bans : type == 'e' ? global_exempts : global_invites);