Support /LIST M to show modes in channels (using the list_chan privilege).
[ircu2.10.12-pk.git] / ircd / ircd_string.c
index 52caed58499033be7ec450e3716fa186446a5e21..1ed082d6f34d6073d5d5d59041b4d8d65c7ad99a 100644 (file)
@@ -156,6 +156,8 @@ char* ircd_strncpy(char* s1, const char* s2, size_t n)
 
   while (s < endp && (*s++ = *s2++))
     ;
+  if (s == endp)
+    *s = '\0';
   return s1;
 }
 
@@ -484,7 +486,7 @@ ircd_aton_ip4(const char *input, unsigned int *output, unsigned char *pbits)
     ip |= part << (24 - 8 * dots++);
     part = 0;
     if (input[pos] == '*') {
-      while (input[++pos] == '*') ;
+      while (input[++pos] == '*' || input[pos] == '.') ;
       if (input[pos] != '\0')
         return 0;
       if (pbits)
@@ -602,7 +604,7 @@ ipmask_parse(const char *input, struct irc_in_addr *ip, unsigned char *pbits)
       *pbits = part;
       goto finish;
     case '*':
-      while (input[++pos] == '*') ;
+      while (input[++pos] == '*' || input[pos] == ':') ;
       if (input[pos] != '\0' || colon < 8)
         return 0;
       if (pbits)