X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Fmysql.c;h=1bc0fdf77b8e4429090d292e7ccc77f54667cc33;hb=f8e1e81d433c5b4e06792c2617abf0e6ec9e76d9;hp=419a154389b768c0e88d67b892f77ef592f3b8e7;hpb=69b8a9a1af204685dfdfaf1279a0f2928e0bbb32;p=collectd.git diff --git a/src/mysql.c b/src/mysql.c index 419a1543..1bc0fdf7 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -28,6 +28,7 @@ **/ #include "collectd.h" + #include "common.h" #include "plugin.h" #include "configfile.h" @@ -103,7 +104,6 @@ static int mysql_config_database (oconfig_item_t *ci) /* {{{ */ { mysql_database_t *db; int status = 0; - int i; if ((ci->values_num != 1) || (ci->values[0].type != OCONFIG_TYPE_STRING)) @@ -143,7 +143,7 @@ static int mysql_config_database (oconfig_item_t *ci) /* {{{ */ assert (db->instance != NULL); /* Fill the `mysql_database_t' structure.. */ - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i; @@ -221,13 +221,11 @@ static int mysql_config_database (oconfig_item_t *ci) /* {{{ */ static int mysql_config (oconfig_item_t *ci) /* {{{ */ { - int i; - if (ci == NULL) return (EINVAL); /* Fill the `mysql_database_t' structure.. */ - for (i = 0; i < ci->children_num; i++) + for (int i = 0; i < ci->children_num; i++) { oconfig_item_t *child = ci->children + i;