From b79837538f03ad47506abc53a86c7a54d90d4cf5 Mon Sep 17 00:00:00 2001 From: "certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b" Date: Tue, 4 Jul 2006 20:28:26 +0000 Subject: Undoing last commit because it isn't needed. git-svn-id: svn://svn.anope.org/anope/trunk@1081 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@805 5417fbe8-f217-4b02-8779-1006273d7864 --- src/mysql.c | 29 ++++++++++------------------- 1 file changed, 10 insertions(+), 19 deletions(-) (limited to 'src/mysql.c') diff --git a/src/mysql.c b/src/mysql.c index 889dcd40d..af319d5b6 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -983,13 +983,10 @@ void db_mysql_load_news(void) mysql_free_result(mysql_res); } -#define HASH(host) (((host)[0]&31)<<5 | ((host)[1]&31)) - void db_mysql_load_exceptions(void) { char sqlcmd[MAX_SQL_BUF]; - Exception *exception; - int index; + int j; if (!do_mysql) return; @@ -1003,26 +1000,20 @@ void db_mysql_load_exceptions(void) } mysql_res = mysql_store_result(mysql); nexceptions = mysql_num_rows(mysql_res); - exception = scalloc(sizeof(Exception), 1); + exceptions = scalloc(sizeof(Exception) * nexceptions, 1); + j = 0; while ((mysql_row = mysql_fetch_row(mysql_res))) { - exception->mask = sstrdup(mysql_row[0]); - exception->limit = atoi(mysql_row[1]); - snprintf(exception->who, NICKMAX, "%s", mysql_row[2]); - exception->reason = sstrdup(mysql_row[3]); - exception->time = atoi(mysql_row[4]); - exception->expires = atoi(mysql_row[5]); - index = HASH(exception->mask); - exception->prev = NULL; - exception->next = exceptionlist[index]; - if (exception->next) - exception->next->prev = exception; - exceptionlist[index] = exception; + exceptions[j].mask = sstrdup(mysql_row[0]); + exceptions[j].limit = atoi(mysql_row[1]); + snprintf(exceptions[j].who, NICKMAX, "%s", mysql_row[2]); + exceptions[j].reason = sstrdup(mysql_row[3]); + exceptions[j].time = atoi(mysql_row[4]); + exceptions[j].expires = atoi(mysql_row[5]); + j++; } mysql_free_result(mysql_res); } -#undef HASH - #define HASH(host) ((tolower((host)[0])&31)<<5 | (tolower((host)[1])&31)) void db_mysql_load_os_dbase(void) -- cgit