]> jfr.im git - irc/rqf/shadowircd.git/blobdiff - extensions/ip_cloaking.c
help system rework, part 1
[irc/rqf/shadowircd.git] / extensions / ip_cloaking.c
index 0f0932c930ffdd63e5eb78c61945238770dac3ba..5b9c5f420f1c8e9a8dca2df5fe4e6e99c43267ad 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: ip_cloaking.c 3522 2007-07-06 07:48:28Z nenolod $ */
+/* $Id: ip_cloaking.c 3526 2007-07-06 07:56:14Z nenolod $ */
 
 #include "stdinc.h"
 #include "modules.h"
@@ -42,7 +42,7 @@ mapi_hfn_list_av1 ip_cloaking_hfnlist[] = {
 };
 
 DECLARE_MODULE_AV1(ip_cloaking, _modinit, _moddeinit, NULL, NULL,
-                       ip_cloaking_hfnlist, "$Revision: 3522 $");
+                       ip_cloaking_hfnlist, "$Revision: 3526 $");
 
 static void
 distribute_hostchange(struct Client *client)
@@ -107,6 +107,13 @@ do_host_cloak_ip(const char *inbuf, char *outbuf)
 
        strncpy(buf, inbuf, HOSTLEN);
        tptr = strrchr(buf, '.');
+
+       if (tptr == NULL)
+       {
+               strncpy(outbuf, inbuf, HOSTLEN);
+               return;
+       }
+
        *tptr++ = '\0';
 
        snprintf(outbuf, HOSTLEN, "%s.%x", buf, accum);