]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP/MINOR: standard: use the system define INET6_ADDRSTRLEN in place of MAX_IP6_LEN
authorThierry FOURNIER <tfournier@exceliance.fr>
Wed, 11 Dec 2013 11:33:54 +0000 (12:33 +0100)
committerWilly Tarreau <w@1wt.eu>
Wed, 11 Dec 2013 21:03:00 +0000 (22:03 +0100)
src/standard.c

index 1b7fdb0b720381dfc493efeb531d2e9c85c4c20b..ebbc70c6221e579ba2f0c81fa571023e3cc07035 100644 (file)
@@ -1696,12 +1696,11 @@ int buf2ip(const char *buf, size_t len, struct in_addr *dst)
  * struct in6_addr <dst> which must be allocated by the caller.
  * This function returns 1 in success case, otherwise zero.
  */
-#define MAX_IP6_LEN 45
 int buf2ip6(const char *buf, size_t len, struct in6_addr *dst)
 {
-       char null_term_ip6[MAX_IP6_LEN + 1];
+       char null_term_ip6[INET6_ADDRSTRLEN + 1];
 
-       if (len > MAX_IP6_LEN)
+       if (len > INET6_ADDRSTRLEN)
                return 0;
 
        memcpy(null_term_ip6, buf, len);