From 9e293a086cd8b8f5ca4a1303eee4701f03c9b4c3 Mon Sep 17 00:00:00 2001 From: pk910 Date: Sun, 14 Aug 2011 22:35:23 +0200 Subject: [PATCH] fixed MYSQL_RES parsing --- bot_NeonServ.c | 6 +++--- mysqlConn.c | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) 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() { -- 2.20.1