From 06ad08cb970cc55711cdca968f79f90610dbbf58 Mon Sep 17 00:00:00 2001 From: usev6 Date: Tue, 30 Apr 2019 07:39:23 +0200 Subject: [PATCH] Declare var inside loop (code review change) --- src/utils/format_graphite/format_graphite.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/utils/format_graphite/format_graphite.c b/src/utils/format_graphite/format_graphite.c index 32bd64ef..ffef3e2f 100644 --- a/src/utils/format_graphite/format_graphite.c +++ b/src/utils/format_graphite/format_graphite.c @@ -36,9 +36,8 @@ /* helper function for reverse_hostname */ void reverse_string(char *r_host, int len) { - char t; for (int i = 0, j = len - 1; i < j; i++, j--) { - t = r_host[i]; + char t = r_host[i]; r_host[i] = r_host[j]; r_host[j] = t; } -- 2.11.0