Miscellaneous bugfixes from recent commits, and a file omitted from last commit.
[ircu2.10.12-pk.git] / ircd / numnicks.c
index 931c1ca83b0eb53f38f54bca93fbf5e317f18521..1e41917375fa2a9bffb6e13f1c35288a0bd98a22 100644 (file)
@@ -440,11 +440,14 @@ struct Client* find_match_server(char *mask)
  * @param[in] addr IP address to encode.
  * @param[in] count Number of bytes writable to \a buf.
  */
-const char* iptobase64(char* buf, const struct irc_in_addr* addr, unsigned int count)
+const char* iptobase64(char* buf, const struct irc_in_addr* addr, unsigned int count, int v6_ok)
 {
   if (irc_in_addr_is_ipv4(addr)) {
     assert(count >= 6);
     inttobase64(buf, (htons(addr->in6_16[6]) << 16) | htons(addr->in6_16[7]), 6);
+  } else if (!v6_ok) {
+    assert(count >= 6);
+    strcpy(buf, "AAAAAA");
   } else {
     unsigned int max_start, max_zeros, curr_zeros, zero, ii;
     char *output = buf;