fixed WIN32 compatibility
[NeonServV5.git] / src / DBHelper.c
index 9fa6c1cad7a2a7ba460ea3899f14fafde6d9bc95..56bd924e41f2bb2c2e22add62265ad505ef0f2c4 100644 (file)
@@ -287,7 +287,7 @@ static int event_user_registered(struct UserNode *old_user, struct UserNode *new
         }
         cache->new_user = new_user;
         cache->oldauth = strdup(oldauth);
-        lookup_authname(newauth, event_user_registered_auth_lookup, cache);
+        lookup_authname(newauth, 0, event_user_registered_auth_lookup, cache);
     }
     return 1;
 }
@@ -314,7 +314,7 @@ void deleteUser(int userid) {
             //unregister channel
             printf_mysql_query("SELECT `botid`, `channel_name` FROM `bot_channels` LEFT JOIN `channels` ON `chanid` = `channel_id` WHERE `chanid` = '%s' AND `suspended` = '0'", row[1]);
             res2 = mysql_use();
-            while((row2 = mysql_fetch_row(res))) {
+            while((row2 = mysql_fetch_row(res2))) {
                 struct ClientSocket *bot;
                 int clientid = atoi(row2[0]);
                 for(bot = getBots(SOCKET_FLAG_READY, NULL); bot; bot = getBots(SOCKET_FLAG_READY, bot)) {
@@ -343,6 +343,6 @@ void deleteUser(int userid) {
 }
 
 void init_DBHelper() {
-    bind_registered(event_user_registered);
+    bind_registered(event_user_registered, 0);
 }