From: Ruben Kerkhof Date: Thu, 31 May 2018 14:51:34 +0000 (+0200) Subject: uuid plugin: fix implicit conversion warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=bb9b8606ecc6526d7423a7135a3b8ce7ab5e9fec;p=collectd.git uuid plugin: fix implicit conversion warning CC src/uuid.lo src/uuid.c:50:9: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] len = strlen(uuid); ~ ^~~~~~~~~~~~ 1 warning generated. --- diff --git a/src/uuid.c b/src/uuid.c index 39b1fe6f..c7878c74 100644 --- a/src/uuid.c +++ b/src/uuid.c @@ -42,13 +42,10 @@ static char *uuidfile; static const char *config_keys[] = {"UUIDFile"}; static int looks_like_a_uuid(const char *uuid) { - int len; - if (!uuid) return 0; - len = strlen(uuid); - + size_t len = strlen(uuid); if (len < UUID_PRINTABLE_COMPACT_LENGTH) return 0;