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 <peter@lekensteyn.nl>
Signed-off-by: Thomas Haller <thaller@redhat.com>
This commit is contained in:
Peter Wu 2014-06-24 23:13:38 +02:00 committed by Thomas Haller
parent 8e052f59f4
commit a8b352a4c5

View file

@ -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.