瀏覽代碼

* Fix botconfig having an extra space if no ipv6 used

Bryan Drewery 16 年之前
父節點
當前提交
2c01b4b4e7
共有 1 個文件被更改,包括 5 次插入2 次删除
  1. 5 2
      src/conf.c

+ 5 - 2
src/conf.c

@@ -805,10 +805,13 @@ writeconf(char *filename, int fd, int bits)
 
 
 #endif /* CYGWIN_HACKS */
 #endif /* CYGWIN_HACKS */
   for (bot = conf.bots; bot && bot->nick; bot = bot->next) {
   for (bot = conf.bots; bot && bot->nick; bot = bot->next) {
-    *stream << buf.printf(STR("%s%s %s %s%s %s\n"),
+    *stream << buf.printf(STR("%s%s %s %s%s"),
              bot->disabled ? "/" : "", bot->nick,
              bot->disabled ? "/" : "", bot->nick,
              bot->net.ip ? bot->net.ip : "*", bot->net.host6 ? "+" : "",
              bot->net.ip ? bot->net.ip : "*", bot->net.host6 ? "+" : "",
-             bot->net.host ? bot->net.host : (bot->net.host6 ? bot->net.host6 : "*"), bot->net.ip6 ? bot->net.ip6 : "");
+             bot->net.host ? bot->net.host : (bot->net.host6 ? bot->net.host6 : "*"));
+    if (bot->net.ip6)
+      *stream << buf.printf(STR(" %s"), bot->net.ip6 ? bot->net.ip6 : "");
+    *stream << "\n";
   }
   }
 
 
   if (fd != -1)
   if (fd != -1)