summaryrefslogtreecommitdiff
path: root/mysql.c
diff options
context:
space:
mode:
authorkeeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-05-08 10:07:53 +0000
committerkeeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b <keeper keeper@31f1291d-b8d6-0310-a050-a5561fc1590b@5417fbe8-f217-4b02-8779-1006273d7864>2004-05-08 10:07:53 +0000
commit5effa3fee27d8e8cb8b583ec84bc1ec72cd6f30b (patch)
treedd8f3feaa1ac380e3e76cddeaa135c9d5704c309 /mysql.c
parentf37f02692d56c8bc69900357aa0006f203eb03d8 (diff)
BUILD : 1.7.2 (88) BUGS : 13 and 14 NOTES : Hopefully fixed empty nickserv-accesslist entries and corrupt mysql code
git-svn-id: svn://svn.anope.org/anope/trunk@88 31f1291d-b8d6-0310-a050-a5561fc1590b git-svn-id: http://anope.svn.sourceforge.net/svnroot/anope/trunk@64 5417fbe8-f217-4b02-8779-1006273d7864
Diffstat (limited to 'mysql.c')
-rw-r--r--mysql.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/mysql.c b/mysql.c
index 8366d5c74..442af9843 100644
--- a/mysql.c
+++ b/mysql.c
@@ -104,10 +104,14 @@ int db_mysql_open()
int db_mysql_query(char *sql)
{
-
int result, lcv;
char *s = db_mysql_quote(sql);
+ if (!do_mysql) {
+ free(s);
+ return -1;
+ }
+
if (debug)
alog(s);
free(s);
@@ -151,8 +155,9 @@ char *db_mysql_quote(char *sql)
{
int slen;
char *quoted;
+
- if (!sql) {
+ if (!sql || !do_mysql) {
return sstrdup("");
}
@@ -1521,8 +1526,10 @@ void db_mysql_load_ns_dbase(void)
}
res = mysql_store_result(mysql);
while ((row = mysql_fetch_row(res))) {
- *access = sstrdup(row[0]);
- access++;
+ if (strlen(row[0]) > 0) {
+ *access = sstrdup(row[0]);
+ access++;
+ }
}
mysql_free_result(res);
}