fixed MYSQL_RES parsing
authorpk910 <philipp@zoelle1.de>
Sun, 14 Aug 2011 20:35:23 +0000 (22:35 +0200)
committerpk910 <philipp@zoelle1.de>
Sun, 14 Aug 2011 20:35:23 +0000 (22:35 +0200)
bot_NeonServ.c
mysqlConn.c

index 1ee7fe45930a75800d6b92f7acd87c7c15284ad4..60b5d87d1e4e84d09c028e80be49eade7c8752f5 100644 (file)
@@ -57,10 +57,10 @@ static void start_bots() {
         strcpy(user->ident, row[1]);
         strcpy(user->realname, row[2]);
         user->flags |= USERFLAG_ISBOT;
-        client = create_socket(row[3], *row[4], row[5], user);
-        client->flags |= (*row[6] == 1 ? SOCKET_FLAG_PREFERRED : 0);
+        client = create_socket(row[3], atoi(row[4]), row[5], user);
+        client->flags |= (strcmp(row[6], "0") ? SOCKET_FLAG_PREFERRED : 0);
         client->botid = BOTID;
-        client->clientid = *row[7];
+        client->clientid = atoi(row[7]);
         connect_socket(client);
         
     }
index 9f2ba7f6016a0e59de332fa454398d09842a8b9d..e62ef3f4b4e3f11583842f2d92d64c5fe4350cbb 100644 (file)
@@ -41,12 +41,14 @@ void mysql_free() {
         mysql_free_result(result->result);
         free(result);
     }
+    used_results = NULL;
     struct escaped_string *escaped, *next_escaped;
     for(escaped = escaped_strings; escaped; escaped = next_escaped) {
         next_escaped = escaped->next;
         free(escaped->string);
         free(escaped);
     }
+    escaped_strings = NULL
 }
 
 void init_mysql() {