fixed cmd_global_unregister.c: invalid return
authorpk910 <philipp@zoelle1.de>
Sun, 1 Jul 2012 15:01:00 +0000 (17:01 +0200)
committerpk910 <philipp@zoelle1.de>
Sun, 1 Jul 2012 15:01:00 +0000 (17:01 +0200)
src/modules/global.mod/cmd_global_unregister.c

index daa173715825188f974c3265ed78d1753af111ed..37149bc24b15e1a64ddf3a1f71f6eef546080e62 100644 (file)
@@ -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