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:
parent
8e052f59f4
commit
a8b352a4c5
1 changed files with 1 additions and 1 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Reference in a new issue