From: usev6 Date: Tue, 30 Apr 2019 05:39:23 +0000 (+0200) Subject: Declare var inside loop (code review change) X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=06ad08cb970cc55711cdca968f79f90610dbbf58;p=collectd.git Declare var inside loop (code review change) --- 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; }