From 46b0115778adaf9210a92807eabbb6ee5165c3df Mon Sep 17 00:00:00 2001 From: Michal Privoznik Date: Wed, 21 May 2025 14:52:55 +0200 Subject: [PATCH] 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 --- tools/nss/libvirt_nss_macs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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"); -- 2.47.2