- dnsbl.c:dnsbl_positive(): fixed weird logic that could result in 'text_type' being...
authormichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Wed, 8 Jul 2015 12:57:57 +0000 (12:57 +0000)
committermichael <michael@82007160-df01-0410-b94d-b575c5fd34c7>
Wed, 8 Jul 2015 12:57:57 +0000 (12:57 +0000)
  with two commas which later would defeat the purpose of *(strrchr(text_type, ',')) = '\0'

git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.1.x@6233 82007160-df01-0410-b94d-b575c5fd34c7

src/dnsbl.c

index f8ea9a471f23de34c9682d81084cab616fe0c2e0..d73cd4ff48d78df480c575e6d3823eec692c37d0 100644 (file)
@@ -111,11 +111,8 @@ dnsbl_positive(struct scan_struct *ss, struct BlacklistConf *bl, unsigned char t
 
       if (item->number & type)
       {
-        strncat(text_type, item->type, sizeof(text_type) - strlen(text_type) - 2);
-        text_type[sizeof(text_type) - 2] = '\0';
-
-        strncat(text_type, ", ", sizeof(text_type) - strlen(text_type) - 1);
-        text_type[sizeof(text_type) - 1] = '\0';
+        strlcat(text_type, item->type, sizeof(text_type));
+        strlcat(text_type, ", ", sizeof(text_type));
       }
     }