tests/test_nlattr.h: fix pointer calculation in TEST_NLATTR_ARRAY
The old code works only when an array contains exactly two items. * tests/test_nlattr.h (TEST_NLATTR_ARRAY): Fix pointer address for the case of incomplete read.
This commit is contained in:
parent
7ff51ab3d8
commit
acd3d3e992
@ -187,7 +187,7 @@ print_nlattr(const unsigned int nla_len, const char *const nla_type)
|
||||
} \
|
||||
printf(", %p]", \
|
||||
RTA_DATA(NLMSG_ATTR(nlh, (hdrlen_))) \
|
||||
+ sizeof((obj_)[0]))); \
|
||||
+ sizeof(obj_) - sizeof((obj_)[0]))); \
|
||||
/* sizeof(obj_) */ \
|
||||
TEST_NLATTR_((fd_), (nlh0_), (hdrlen_), \
|
||||
(init_msg_), (print_msg_), \
|
||||
|
Loading…
x
Reference in New Issue
Block a user