X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fchrony.c;h=6fb369a2f167b043618318b98c88764902fd5540;hb=0d9f395599348e735e6f461e1c328293bef0d060;hp=74dae52d6fd04dac78704ee62f3c56bc1c1308e0;hpb=d46c9cada2398d5508205e745c42c1cdc6efd1e9;p=collectd.git diff --git a/src/chrony.c b/src/chrony.c index 74dae52d..6fb369a2 100644 --- a/src/chrony.c +++ b/src/chrony.c @@ -348,11 +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, c; size_t j = 0; - for (i = 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;