summaryrefslogtreecommitdiffstats
path: root/lib/msg.c
diff options
context:
space:
mode:
authorMichael Forney <mforney@mforney.org>2019-08-11 04:49:07 (GMT)
committerThomas Haller <thaller@redhat.com>2019-08-16 05:42:03 (GMT)
commitde72910e6b3ec4503f23538682a89c4d444c7a92 (patch)
treeadb4ac751ff7e9d2cbf3a17d9c2191fb0d80e56f /lib/msg.c
parent1a88619b72c77b5390076ad703bfa3de4fa0348d (diff)
downloadlibnl-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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/msg.c b/lib/msg.c
index e3fb629..c08b3a4 100644
--- a/lib/msg.c
+++ b/lib/msg.c
@@ -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);
}
}