X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fntpd.c;h=dbde6609f64527ff8d58c91a4e9fda5f53e226e6;hb=089eb4f23a447427172601125bc65116b5f0a661;hp=15b12f92bedd4b6cbd2a1be0f87967a7a62f62e4;hpb=2421812ea47269c50920414a6e3c32448800120f;p=collectd.git diff --git a/src/ntpd.c b/src/ntpd.c index 15b12f92..dbde6609 100644 --- a/src/ntpd.c +++ b/src/ntpd.c @@ -38,9 +38,6 @@ #if HAVE_NETDB_H # include #endif -#if HAVE_SYS_SOCKET_H -# include -#endif #if HAVE_NETINET_IN_H # include #endif @@ -265,7 +262,7 @@ static char *refclock_names[] = "JJY", "TT_IRIG", "GPS_ZYFER", "GPS_RIPENCC", /* 40-43 */ "NEOCLK4X" /* 44 */ }; -static int refclock_names_num = STATIC_ARRAY_SIZE (refclock_names); +static size_t refclock_names_num = STATIC_ARRAY_SIZE (refclock_names); /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * End of the copied stuff.. * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ @@ -670,7 +667,6 @@ static int ntpd_receive_response (int *res_items, int *res_size, (items_num + pkt_item_num) * res_item_size); if (items == NULL) { - items = *res_data; ERROR ("ntpd plugin: realloc failed."); continue; } @@ -869,7 +865,7 @@ static int ntpd_get_name_refclock (char *buffer, size_t buffer_size, uint32_t refclock_id = ntpd_get_refclock_id (peer_info); uint32_t unit_id = ntohl (peer_info->srcadr) & 0x00FF; - if (refclock_id >= refclock_names_num) + if (((size_t) refclock_id) >= refclock_names_num) return (ntpd_get_name_from_address (buffer, buffer_size, peer_info, /* do_reverse_lookup = */ 0));