From 09428c96b549bed7f0066815b579ce0018cc63d0 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 1 Jul 2012 17:01:00 +0200 Subject: [PATCH] fixed cmd_global_unregister.c: invalid return --- .../global.mod/cmd_global_unregister.c | 20 +++++++++---------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/src/modules/global.mod/cmd_global_unregister.c b/src/modules/global.mod/cmd_global_unregister.c index daa1737..37149bc 100644 --- a/src/modules/global.mod/cmd_global_unregister.c +++ b/src/modules/global.mod/cmd_global_unregister.c @@ -70,17 +70,15 @@ CMD_BIND(global_cmd_unregister) { if(client->botid == NEONSERV_BOTID && sync_neonspam_unreg) { printf_mysql_query("SELECT `botid`, `bot_channels`.`id`, `suspended` FROM `bot_channels` LEFT JOIN `bots` ON `bot_channels`.`botid` = `bots`.`id` LEFT JOIN `channels` ON `chanid` = `channel_id` WHERE `channel_name` = '%s' AND `botclass` = '%d'", escape_string(channel), NEONSPAM_BOTID); res = mysql_use(); - if ((row = mysql_fetch_row(res)) == NULL) { - return; - } - botid = atoi(row[0]); - for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) { - if(bot->clientid == botid) - break; - } - printf_mysql_query("DELETE FROM `bot_channels` WHERE `id` = '%s'", row[1]); - if(bot && strcmp(row[2], "1")) { - putsock(bot, "PART %s :Channel unregistered.", channel); + if ((row = mysql_fetch_row(res))) { + botid = atoi(row[0]); + for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) { + if(bot->clientid == botid) + break; + } + printf_mysql_query("DELETE FROM `bot_channels` WHERE `id` = '%s'", row[1]); + if(bot && strcmp(row[2], "1")) + putsock(bot, "PART %s :Channel unregistered.", channel); } } // NeonBackup SubBlock -- 2.20.1