From: Thierry FOURNIER Date: Wed, 11 Dec 2013 11:33:54 +0000 (+0100) Subject: CLEANUP/MINOR: standard: use the system define INET6_ADDRSTRLEN in place of MAX_IP6_LEN X-Git-Tag: v1.5-dev20~60 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cd6599150f3a12459e9fcd1cd45be207f12bb4be;p=thirdparty%2Fhaproxy.git CLEANUP/MINOR: standard: use the system define INET6_ADDRSTRLEN in place of MAX_IP6_LEN --- diff --git a/src/standard.c b/src/standard.c index 1b7fdb0b72..ebbc70c622 100644 --- a/src/standard.c +++ b/src/standard.c @@ -1696,12 +1696,11 @@ int buf2ip(const char *buf, size_t len, struct in_addr *dst) * struct in6_addr 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);