1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 17:13:12 +02:00

+- Small fix for #427583 mode bug

This commit is contained in:
stskeeps
2001-12-26 23:35:25 +00:00
parent 9c947f140e
commit c07e8962e5
2 changed files with 21 additions and 13 deletions
+1
View File
@@ -1037,3 +1037,4 @@ seen. gmtime warning still there
- Fixed yet another Win32 editor bug affecting Windows 95/98/NT4,
found by HA|Raptor
- If host == null, don't set it (m_oper, was setting it to "eek.host.is.null.pointer")
- Small fix for #427583 mode bug
+20 -13
View File
@@ -84,7 +84,8 @@ static void set_mode PROTO((aChannel *, aClient *, int, char **, u_int *,
char[MAXMODEPARAMS][MODEBUFLEN + 3], int));
static void make_mode_str PROTO((aChannel *, long, long, int,
char[MAXMODEPARAMS][MODEBUFLEN + 3], char *, char *, char));
static int do_mode_char PROTO((aChannel *, long, char, char *, u_int, aClient *,
static int do_mode_char PROTO((aChannel *, long, char, char *,
u_int, aClient *,
u_int *, char[MAXMODEPARAMS][MODEBUFLEN + 3], char));
static void do_mode PROTO((aChannel *, aClient *, aClient *, int, char **, int,
int));
@@ -1434,7 +1435,7 @@ void make_mode_str(aChannel *chptr, long oldm, long oldl, int pcount,
aCtab *tab = &cFlagTab[0];
char *x = mode_buf;
int what, cnt, z;
char *m;
what = 0;
*tmpbuf = '\0';
@@ -1524,11 +1525,17 @@ void make_mode_str(aChannel *chptr, long oldm, long oldl, int pcount,
}
*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;
@@ -1554,7 +1561,8 @@ void make_mode_str(aChannel *chptr, long oldm, long oldl, int pcount,
* modified for Unreal by stskeeps..
*/
int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_int what, aClient *cptr,
int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param,
u_int what, aClient *cptr,
u_int *pcount, char pvar[MAXMODEPARAMS][MODEBUFLEN + 3], char bounce)
{
aCtab *tab = &cFlagTab[0];
@@ -1728,7 +1736,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
default:
xxx = "whatthefuckisthatmode?";
}
if (!param || *pcount >= MAXMODEPARAMS)
if (!param || *pcount >= MAXMODEPARAMS || )
{
retval = 0;
break;
@@ -1791,7 +1799,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
member->flags |= modetype;
else
member->flags &= ~modetype;
if (tmp == member->flags && (bounce || !IsULine(cptr)))
if ((tmp == member->flags) && (bounce || !IsULine(cptr)))
break;
/* It's easier to undo the mode here instead of later
* when you call make_mode_str for a bounce string.
@@ -1813,7 +1821,7 @@ int do_mode_char(aChannel *chptr, long modetype, char modechar, char *param, u_
membership->flags = member->flags;
(void)ircsprintf(pvar[*pcount], "%c%c%s",
what == MODE_ADD ? '+' : '-', tc, who->name);
(*paramsz) += strlen(who->name);
(*pcount)++;
break;
case MODE_LIMIT:
@@ -2220,8 +2228,7 @@ void set_mode(aChannel *chptr, aClient *cptr, int parc, char *parv[], u_int *pco
me.name, cptr->name, *curchr);
break;
}
if (parv[paracount] &&
strlen(parv[paracount]) >= MODEBUFLEN)
if (parv[paracount] && ((strlen(parv[paracount]) >= MODEBUFLEN)))
parv[paracount][MODEBUFLEN - 1] = '\0';
paracount +=
do_mode_char(chptr, modetype, *curchr,