From: pk910 Date: Sun, 14 Aug 2011 20:35:23 +0000 (+0200) Subject: fixed MYSQL_RES parsing X-Git-Tag: v5.3~550 X-Git-Url: http://git.pk910.de/?a=commitdiff_plain;h=9e293a086cd8b8f5ca4a1303eee4701f03c9b4c3;p=NeonServV5.git fixed MYSQL_RES parsing --- diff --git a/bot_NeonServ.c b/bot_NeonServ.c index 1ee7fe4..60b5d87 100644 --- a/bot_NeonServ.c +++ b/bot_NeonServ.c @@ -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); } diff --git a/mysqlConn.c b/mysqlConn.c index 9f2ba7f..e62ef3f 100644 --- a/mysqlConn.c +++ b/mysqlConn.c @@ -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() {