From: Ruben Kerkhof Date: Fri, 1 Jun 2018 12:29:51 +0000 (+0200) Subject: mysql plugin: fix implicit conversion warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=7e388b6afd64d36de669b72b3d25c3339f33408c;p=collectd.git mysql plugin: fix implicit conversion warning CC src/mysql_la-mysql.lo src/mysql.c:366:19: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int query_len = strlen(query); ~~~~~~~~~ ^~~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/mysql.c b/src/mysql.c index 40707be3..e7ffb489 100644 --- a/src/mysql.c +++ b/src/mysql.c @@ -363,7 +363,7 @@ static void traffic_submit(derive_t rx, derive_t tx, mysql_database_t *db) { static MYSQL_RES *exec_query(MYSQL *con, const char *query) { MYSQL_RES *res; - int query_len = strlen(query); + size_t query_len = strlen(query); if (mysql_real_query(con, query, query_len)) { ERROR("mysql plugin: Failed to execute query: %s", mysql_error(con));