X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fchrony.c;h=6fb369a2f167b043618318b98c88764902fd5540;hb=0d9f395599348e735e6f461e1c328293bef0d060;hp=a5e85a8a84b1a42e2a2eff7384027c397c3c9fb0;hpb=867ad628dc6fcd05bd584b605d7093cfc00c3d07;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;