From 669fa79b21b1316523ce636263a283d12b3b4c1e Mon Sep 17 00:00:00 2001 From: Oliver Hartkopp Date: Fri, 29 May 2020 19:06:49 +0200 Subject: [PATCH] j1939: Fix arithmetic on a pointer warning Fix missing (recently introduced) j1939 files that have not been fixed in commit 43610bd6217c ("Fix arithmetic on a pointer warning") from Gary Bisson. Signed-off-by: Oliver Hartkopp --- j1939cat.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/j1939cat.c b/j1939cat.c index 6810866..a37c5ba 100644 --- a/j1939cat.c +++ b/j1939cat.c @@ -165,11 +165,11 @@ static void j1939cat_scm_opt_stats(struct j1939cat_priv *priv, void *buf, int le int offset = 0; while (offset < len) { - struct nlattr *nla = (struct nlattr *) (buf + offset); + struct nlattr *nla = (struct nlattr *) ((char *)buf + offset); switch (nla->nla_type) { case J1939_NLA_BYTES_ACKED: - stats->send = *(uint32_t *)((void *)nla + NLA_HDRLEN); + stats->send = *(uint32_t *)((char *)nla + NLA_HDRLEN); break; default: warnx("not supported J1939_NLA field\n");