summaryrefslogtreecommitdiff
path: root/src/mysql.c
diff options
context:
space:
mode:
authorcertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-07-04 20:28:26 +0000
committercertus certus@31f1291d-b8d6-0310-a050-a5561fc1590b <certus certus@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2006-07-04 20:28:26 +0000
commitb79837538f03ad47506abc53a86c7a54d90d4cf5 (patch)
tree61167019efc2c66f5746c8fdd058e73f5540ff06 /src/mysql.c
parent3323816264fc01ccfb455b61bf43cbe8621532cf (diff)
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
Diffstat (limited to 'src/mysql.c')
-rw-r--r--src/mysql.c29
1 files changed, 10 insertions, 19 deletions
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)