From a8b352a4c50b0e44d53c5a74388f942523224171 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Tue, 24 Jun 2014 23:13:38 +0200 Subject: [PATCH] attr: fix compile warning in headers strlen() returns a size_t type, but nla_put accepts an int only. This breaks a -Werror build of applications using libnl, so avoid this warning by explicitly casting the length to an int. Signed-off-by: Peter Wu Signed-off-by: Thomas Haller --- include/netlink/attr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/netlink/attr.h b/include/netlink/attr.h index 0ed3da3..82e4c38 100644 --- a/include/netlink/attr.h +++ b/include/netlink/attr.h @@ -205,7 +205,7 @@ extern int nla_is_nested(struct nlattr *); * @arg value NUL terminated character string. */ #define NLA_PUT_STRING(msg, attrtype, value) \ - NLA_PUT(msg, attrtype, strlen(value) + 1, value) + NLA_PUT(msg, attrtype, (int) strlen(value) + 1, value) /** * Add flag attribute to netlink message.