]> jfr.im git - irc/unrealircd/unrealircd.git/commitdiff
still fux0red
authorluke <redacted>
Tue, 28 May 2002 04:12:06 +0000 (04:12 +0000)
committerluke <redacted>
Tue, 28 May 2002 04:12:06 +0000 (04:12 +0000)
src/channel.c

index f2e8ae409d2df1873a5f75cda090fd9299e72f8b..dc856f560e1cccd4159c507d9b48490e384b2f27 100644 (file)
@@ -2081,8 +2081,9 @@ void set_mode(chptr, cptr, parc, parv, pcount, pvar, bounce)
 {
        char *curchr;
        u_int what = MODE_ADD;
-       long modetype;
-       int  paracount;
+       long modetype = 0;
+       char *param = NULL;
+       int  paracount = 1;
 #ifdef DEVELOP
        char *tmpo = NULL;
 #endif
@@ -2163,14 +2164,19 @@ void set_mode(chptr, cptr, parc, parv, pcount, pvar, bounce)
                                      me.name, cptr->name, *curchr);
                                  break;
                          }
+                         /* We can afford to send off a param */
                           if (parc - paracount >= 1)
-                                 parv[paracount] = NULL;
-                         if (parv[paracount] &&
-                             strlen(parv[paracount]) >= MODEBUFLEN)
-                                 parv[paracount][MODEBUFLEN - 1] = '\0';
+                         {
+                                 param = parv[paracount];
+                         }
+                         else
+                                 param = NULL;
+                         
+                         if (param && ((strlen(param) >= MODEBUFLEN)))
+                                 param[MODEBUFLEN - 1] = '\0';
                          paracount +=
                              do_mode_char(chptr, modetype, *curchr,
-                             parv[paracount], what, cptr, pcount, pvar,
+                             param, what, cptr, pcount, pvar,
                              bounce);
                          break;
                }