diff --git a/src/libsystemd/sd-netlink/sd-netlink.c b/src/libsystemd/sd-netlink/sd-netlink.c index 5271c1492d..e23e2cc163 100644 --- a/src/libsystemd/sd-netlink/sd-netlink.c +++ b/src/libsystemd/sd-netlink/sd-netlink.c @@ -270,7 +270,7 @@ int sd_netlink_sendv( return -ENOMEM; } - for (unsigned i = 0; i < msgcount; i++) { + for (size_t i = 0; i < msgcount; i++) { assert_return(!messages[i]->sealed, -EPERM); netlink_seal_message(nl, messages[i]); diff --git a/src/shared/firewall-util-nft.c b/src/shared/firewall-util-nft.c index d6beaf20d8..1970834878 100644 --- a/src/shared/firewall-util-nft.c +++ b/src/shared/firewall-util-nft.c @@ -29,13 +29,16 @@ #define UDP_DPORT_OFFSET 2 -static int nfnl_netlink_sendv(sd_netlink *nfnl, - sd_netlink_message *messages[], - size_t msgcount) { +static int nfnl_netlink_sendv( + sd_netlink *nfnl, + sd_netlink_message **messages, + size_t msgcount) { + _cleanup_free_ uint32_t *serial = NULL; - size_t i; int r; + assert(nfnl); + assert(messages); assert(msgcount > 0); r = sd_netlink_sendv(nfnl, messages, msgcount, &serial); @@ -43,7 +46,7 @@ static int nfnl_netlink_sendv(sd_netlink *nfnl, return r; r = 0; - for (i = 1; i < msgcount - 1; i++) { + for (size_t i = 1; i < msgcount - 1; i++) { int tmp; /* If message is an error, this returns embedded errno */