From: Michal Privoznik Date: Wed, 21 May 2025 12:52:55 +0000 (+0200) Subject: libvirt_nss_macs: Fix type of @len in findMACsFromJSON() X-Git-Tag: v11.4.0-rc1~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=46b0115778adaf9210a92807eabbb6ee5165c3df;p=thirdparty%2Flibvirt.git libvirt_nss_macs: Fix type of @len in findMACsFromJSON() Inside of findMACsFromJSON(), the retval of json_object_array_length() is stored in a variable that's type of int. But the function is declared to return size_t: /usr/include/json-c/json_object.h:JSON_EXPORT size_t json_object_array_length(const struct json_object *obj); Fix the type of the local variable. Signed-off-by: Michal Privoznik Reviewed-by: Jiri Denemark --- diff --git a/tools/nss/libvirt_nss_macs.c b/tools/nss/libvirt_nss_macs.c index c3af9375bc..44544624f3 100644 --- a/tools/nss/libvirt_nss_macs.c +++ b/tools/nss/libvirt_nss_macs.c @@ -46,7 +46,7 @@ findMACsFromJSON(json_object *jobj, size_t *nmacs) { size_t i; - int len; + size_t len; if (!json_object_is_type(jobj, json_type_array)) { ERROR("parsed JSON does not contain the leases array");