From: Ruben Kerkhof Date: Tue, 9 Aug 2016 12:23:06 +0000 (+0200) Subject: utils_dns.c: fix compiler warning X-Git-Tag: collectd-5.6.0~22^2 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=974c66f629c0a6eb8691fe280a28cf0b78b9b574;p=collectd.git utils_dns.c: fix compiler warning utils_dns.c: In function ‘handle_ip’: utils_dns.c:531:29: warning: pointer of type ‘void *’ used in arithmetic [-Wpointer-arith] memcpy(buf, (void *) ip + offset, len - offset); ^ --- diff --git a/src/utils_dns.c b/src/utils_dns.c index f38a7bd1..3e80e869 100644 --- a/src/utils_dns.c +++ b/src/utils_dns.c @@ -527,7 +527,7 @@ handle_ip(const struct ip *ip, int len) return (0); if (IPPROTO_UDP != ip->ip_p) return 0; - memcpy(buf, (void *) ip + offset, len - offset); + memcpy(buf, ((char *)ip) + offset, len - offset); if (0 == handle_udp((struct udphdr *) buf, len - offset)) return 0; return 1;