[srvx-commits] CVS: services/src chanserv.c,1.178,1.179
Brought to you by:
entrope
From: Entrope <en...@us...> - 2001-08-19 01:27:55
|
Update of /cvsroot/srvx/services/src In directory usw-pr-cvs1:/tmp/cvs-serv20701/src Modified Files: chanserv.c Log Message: handle mode changes where strlen(MODE_TARGET_USER(foo)) != 3 Index: chanserv.c =================================================================== RCS file: /cvsroot/srvx/services/src/chanserv.c,v retrieving revision 1.178 retrieving revision 1.179 diff -C2 -r1.178 -r1.179 *** chanserv.c 2001/08/11 17:47:43 1.178 --- chanserv.c 2001/08/19 01:27:52 1.179 *************** *** 2039,2043 **** static CHANSERV_FUNC(cmd_down) { ! char change[6 + (2 * COMBO_NUMERIC_LEN)]; struct modeNode *mn; (void)argv;(void)argc; --- 2039,2043 ---- static CHANSERV_FUNC(cmd_down) { ! char *change; struct modeNode *mn; (void)argv;(void)argc; *************** *** 2059,2062 **** --- 2059,2063 ---- DelChannelVoice(1, &user, channel, channel->channel_info->bot, 0); + change = alloca(6 + 2*strlen(MODE_TARGET_USER(user))); sprintf(change, "-ov %s %s", MODE_TARGET_USER(user), MODE_TARGET_USER(user)); irc_mode(channel->channel_info->bot, channel, change); *************** *** 4227,4232 **** if (!(cData = channel->channel_info)) return; mn = GetUserMode(channel, chanserv); ! if (!mn) return; ! if (mn->modes & MODE_CHANOP) return; AddChannelOp(1, &cData->bot, channel, cData->bot, 1); --- 4228,4232 ---- if (!(cData = channel->channel_info)) return; mn = GetUserMode(channel, chanserv); ! if (!mn || (mn->modes & MODE_CHANOP)) return; AddChannelOp(1, &cData->bot, channel, cData->bot, 1); *************** *** 4561,4569 **** if(protect_user(victim, user, channel->channel_info)) { ! char change[7 + (2 * COMBO_NUMERIC_LEN)]; DelChannelOp(1, &user, channel, channel->channel_info->bot, 0); AddChannelOp(1, &victim, channel, channel->channel_info->bot, 0); sprintf(change, "+o-o %s %s", MODE_TARGET_USER(victim), MODE_TARGET_USER(user)); --- 4561,4570 ---- if(protect_user(victim, user, channel->channel_info)) { ! char *change; DelChannelOp(1, &user, channel, channel->channel_info->bot, 0); AddChannelOp(1, &victim, channel, channel->channel_info->bot, 0); + change = alloca(7+2*strlen(MODE_TARGET_USER(victim))); sprintf(change, "+o-o %s %s", MODE_TARGET_USER(victim), MODE_TARGET_USER(user)); |