X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fchrony.c;h=6fb369a2f167b043618318b98c88764902fd5540;hb=619755ece305a61ed7afb19ca5ca6054c4d43097;hp=a5e85a8a84b1a42e2a2eff7384027c397c3c9fb0;hpb=d45f9cdfc084fc5e8783073b993d58b84deb5d58;p=collectd.git diff --git a/src/chrony.c b/src/chrony.c index a5e85a8a..6fb369a2 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -348,10 +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; + size_t j = 0; - for (i = j = 0; i < 4; i++) { - c = ntohl(nrefid) << i * 8 >> 24; + for (int i = 0; i < 4; i++) { + int c = ntohl(nrefid) << i * 8 >> 24; if (!isalnum(c) || j + 1 >= p_buf_size) continue; p_buf[j++] = c;