From: Ruben Kerkhof Date: Thu, 31 May 2018 14:35:38 +0000 (+0200) Subject: virt plugin: fix implicit conversion warning X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=f8322f27a5cfa8dbd890e3656b77ae77758c45c7;p=collectd.git virt plugin: fix implicit conversion warning src/virt.c:2656:41: warning: implicit conversion loses integer precision: 'unsigned long' to 'int' [-Wshorten-64-to-32] n = strlen(domname) + strlen(devpath) + 2; ~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ --- diff --git a/src/virt.c b/src/virt.c index c6280d12..1ce376cb 100644 --- a/src/virt.c +++ b/src/virt.c @@ -2648,12 +2648,12 @@ static int add_interface_device(struct lv_read_state *state, virDomainPtr dom, static int ignore_device_match(ignorelist_t *il, const char *domname, const char *devpath) { char *name; - int n, r; + int r; if ((domname == NULL) || (devpath == NULL)) return 0; - n = strlen(domname) + strlen(devpath) + 2; + size_t n = strlen(domname) + strlen(devpath) + 2; name = malloc(n); if (name == NULL) { ERROR(PLUGIN_NAME " plugin: malloc failed.");