[IRCServices Coding] xml-import

Andrew Church achurch at achurch.org
Tue Jan 17 21:33:13 PST 2006


>>      I've fixed the problem, thanks for the report.  I'll put out a new
>> release shortly.
>
>It looks like services do import data w/o errors and exist. But it is
>still crashing on second execution (without -import key):
>
>#0  0x281f9209 in new_nickgroupinfo (seed=0x10 <Address 0x10 out of bounds>) at modules/nickserv/util.c:102
>102             for (count = 0; seed[count] != 0; count++)

     Okay, I'm stupid again.  Try this patch:

Index: modules/nickserv/main.c
===================================================================
RCS file: /var/local/cvsroot/ircservices/modules/nickserv/main.c,v
retrieving revision 2.226
diff -u -r2.226 main.c
--- modules/nickserv/main.c	9 Jan 2006 10:19:58 -0000	2.226
+++ modules/nickserv/main.c	17 Jan 2006 12:37:28 -0000
@@ -372,6 +372,11 @@
     strbcpy(ngi->nicks[ngi->mainnick], (const char *)value);
 }
 
+static void *db_new_nickgroup(void)
+{
+    return new_nickgroupinfo(NULL);
+}
+
 static void insert_nickgroup(void *record)
 {
     NickGroupInfo *ngi = add_nickgroupinfo(record);
@@ -435,7 +440,7 @@
 };
 static DBTable nickgroup_dbtable = {
     .name    = "nickgroup",
-    .newrec  = (void *)new_nickgroupinfo,
+    .newrec  = db_new_nickgroup,
     .freerec = (void *)free_nickgroupinfo,
     .insert  = insert_nickgroup,
     .first   = (void *)first_nickgroupinfo,

  --Andrew Church
    achurch at achurch.org
    http://achurch.org/