X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fchrony.c;fp=src%2Fchrony.c;h=74dae52d6fd04dac78704ee62f3c56bc1c1308e0;hb=d46c9cada2398d5508205e745c42c1cdc6efd1e9;hp=a5e85a8a84b1a42e2a2eff7384027c397c3c9fb0;hpb=e0ec7ff9351918c400b88890d1be2d4de7b0dedb;p=collectd.git diff --git a/src/chrony.c b/src/chrony.c index a5e85a8a..74dae52d 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -348,9 +348,10 @@ static char *niptoha(const tChrony_IPAddr *addr, char *p_buf, } static void nreftostr(uint32_t nrefid, char *p_buf, size_t p_buf_size) { - int i, j, c; + int i, c; + size_t j = 0; - for (i = j = 0; i < 4; i++) { + for (i = 0; i < 4; i++) { c = ntohl(nrefid) << i * 8 >> 24; if (!isalnum(c) || j + 1 >= p_buf_size) continue;