From 619755ece305a61ed7afb19ca5ca6054c4d43097 Mon Sep 17 00:00:00 2001 From: Ruben Kerkhof Date: Sat, 8 Jul 2017 11:52:42 +0200 Subject: [PATCH] chrony plugin: small cleanup --- src/chrony.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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; -- 2.11.0