]> git.ipfire.org Git - thirdparty/ntp.git/commitdiff
ntp_io.c:
authorDave Hart <hart@ntp.org>
Fri, 23 Feb 2024 09:09:57 +0000 (09:09 +0000)
committerDave Hart <hart@ntp.org>
Fri, 23 Feb 2024 09:09:57 +0000 (09:09 +0000)
  clean up warnings about math with void *

bk: 65d860e50oLAIM2nanq8IAxdAnAhow

ntpd/ntp_io.c

index bcd4632ce74d9f28f8af507696a20254dd0d497e..42f2d8053cf58c18287ddc63178655cbac0c1d80 100644 (file)
@@ -4811,6 +4811,7 @@ process_routing_msgs(struct asyncio_reader *reader)
 #else
        struct rt_msghdr rtm;
        char *p;
+       char *endp;
 #endif
 
        if (scan_addrs_once) {
@@ -4863,8 +4864,8 @@ process_routing_msgs(struct asyncio_reader *reader)
        {
                msg_type = nh->nlmsg_type;
 #else
-       for (p = buffer;
-            (p + sizeof(struct rt_msghdr)) <= (buffer + cnt);
+       for (p = buffer, endp = p + cnt;
+            (p + sizeof(struct rt_msghdr)) <= endp;
             p += rtm.rtm_msglen)
        {
                memcpy(&rtm, p, sizeof(rtm));