From: Ruben Kerkhof Date: Fri, 1 Jun 2018 12:43:49 +0000 (+0200) Subject: csv plugin: fix implicit conversion warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=54dbaa553a74d24704a0087b0b05360044a09478;p=collectd.git csv plugin: fix implicit conversion warning src/csv.c:193:17: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] int len = strlen(datadir); ~~~ ^~~~~~~~~~~~~~~ --- diff --git a/src/csv.c b/src/csv.c index be59ede0..88726bba 100644 --- a/src/csv.c +++ b/src/csv.c @@ -190,12 +190,12 @@ static int csv_config(const char *key, const char *value) { } datadir = strdup(value); if (datadir != NULL) { - int len = strlen(datadir); + size_t len = strlen(datadir); while ((len > 0) && (datadir[len - 1] == '/')) { len--; datadir[len] = '\0'; } - if (len <= 0) { + if (len == 0) { free(datadir); datadir = NULL; }