diff options
author | Michael Forney <mforney@mforney.org> | 2019-08-11 04:49:07 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2019-08-16 05:42:03 (GMT) |
commit | de72910e6b3ec4503f23538682a89c4d444c7a92 (patch) | |
tree | adb4ac751ff7e9d2cbf3a17d9c2191fb0d80e56f /lib/msg.c | |
parent | 1a88619b72c77b5390076ad703bfa3de4fa0348d (diff) | |
download | libnl-de72910e6b3ec4503f23538682a89c4d444c7a92.zip libnl-de72910e6b3ec4503f23538682a89c4d444c7a92.tar.gz libnl-de72910e6b3ec4503f23538682a89c4d444c7a92.tar.bz2 |
all: Avoid pointer arithmetic on `void *`
ISO C requires that the pointer operand to the binary + operator be to
a complete object type[0].
[0] http://port70.net/~nsz/c/c11/n1570.html#6.5.6p2
Diffstat (limited to 'lib/msg.c')
-rw-r--r-- | lib/msg.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -410,7 +410,7 @@ struct nl_msg *nlmsg_convert(struct nlmsghdr *hdr) */ void *nlmsg_reserve(struct nl_msg *n, size_t len, int pad) { - void *buf = n->nm_nlh; + char *buf = (char *) n->nm_nlh; size_t nlmsg_len = n->nm_nlh->nlmsg_len; size_t tlen; @@ -838,7 +838,7 @@ static void print_genl_hdr(FILE *ofd, void *start) static void *print_genl_msg(struct nl_msg *msg, FILE *ofd, struct nlmsghdr *hdr, struct nl_cache_ops *ops, int *payloadlen) { - void *data = nlmsg_data(hdr); + char *data = nlmsg_data(hdr); if (*payloadlen < GENL_HDRLEN) return data; @@ -901,7 +901,7 @@ static void dump_attrs(FILE *ofd, struct nlattr *attrs, int attrlen, prefix_line(ofd, prefix); fprintf(ofd, " [PADDING] %d octets\n", padlen); - dump_hex(ofd, nla_data(nla) + alen, + dump_hex(ofd, (char *) nla_data(nla) + alen, padlen, prefix); } } |