]> jfr.im git - irc/evilnet/x3.git/commitdiff
Fix topic crash bug
authorrubin <redacted>
Thu, 25 May 2006 18:30:59 +0000 (18:30 +0000)
committerrubin <redacted>
Thu, 25 May 2006 18:30:59 +0000 (18:30 +0000)
ChangeLog
src/proto-p10.c

index 0135c9873b66e6503ebfb3bb133cff00853597a6..2b9121e2f4270182337de499ac0f8a109dc661ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,8 @@
 
 2006-05-25  Alex Schumann  <rubin@afternet.org>
 
+       * src/proto-p10.c: make non-existant server type setting not crash x3.
+
        * src/nickserv.help: Added newby tip to authserv registration 
        help (about < and >)
 
index 7d17423f9b3a734ae2fd826de0a20b260e125e03..333ec571a7050c4723239ff75360f8b98fd4fb32 100644 (file)
@@ -925,12 +925,15 @@ irc_topic(struct userNode *service, struct userNode *who, struct chanNode *what,
    int type = 4;
    const char *str;
    str = conf_get_data("server/type", RECDB_QSTRING);
-   type = atoi(str);
+   if(str)
+     type = atoi(str);
+   else
+     type = 4;/* default to 040 style topics */
 
    if (type == 5) {
      putsock("%s " P10_TOPIC " %s %s " FMT_TIME_T " " FMT_TIME_T " :%s", service->numeric, what->name, who->nick, what->timestamp, now, topic);
    } else {
-     who = service; /* REMOVE LINE FOR NEFARIOUS 0.5.0 */
+     who = service;
      putsock("%s " P10_TOPIC " %s :%s", who->numeric, what->name, topic);
    }
 }