diff --git a/Changes b/Changes index 3e1fb8c5c..844d086ba 100644 --- a/Changes +++ b/Changes @@ -343,7 +343,9 @@ Moved cloak key definitions to unrealircd.conf --Luke =================================== -omfg, I screwed up the mode patch so that desynchs -occurred with fucked -bbbbbb modes. Fixed now! +omfg, a patch that resolved some really interesting +problems with really long parameter modes has been +applied. --Luke =================================== + diff --git a/src/channel.c b/src/channel.c index 4f97e3a8e..9de22ff5c 100644 --- a/src/channel.c +++ b/src/channel.c @@ -1367,7 +1367,7 @@ void make_mode_str(chptr, oldm, oldl, pcount, pvar, mode_buf, parabuf, bounce) aCtab *tab = &cFlagTab[0]; char *x = mode_buf; int what, cnt, z; - + char *m; what = 0; *tmpbuf = '\0'; @@ -1457,11 +1457,17 @@ void make_mode_str(chptr, oldm, oldl, pcount, pvar, mode_buf, parabuf, bounce) } *x++ = *(pvar[cnt] + 1); tmpstr = &pvar[cnt][2]; - strncat(parabuf, tmpstr, MODEBUFLEN - 1); - parabuf[MODEBUFLEN - 1] = '\0'; - z = strlen(parabuf); - parabuf[z] = ' '; /* add a space */ - parabuf[z + 1] = '\0'; + z = MODEBUFLEN - 1 - strlen(parabuf); + m = parabuf; + while ((*m)) { m++; } + while ((*tmpstr) && ((m-parabuf) < z)) + { + *m = *tmpstr; + m++; + tmpstr++; + } + *m++ = ' '; + *m = '\0'; } if (bounce) chptr->mode.mode = oldm;