j1939: Fix arithmetic on a pointer warning

Fix missing (recently introduced) j1939 files that have not been fixed
in commit 43610bd621 ("Fix arithmetic on a pointer warning") from
Gary Bisson.

Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/221/head
Oliver Hartkopp 2020-05-29 19:06:49 +02:00
parent 75d9c7e95f
commit 669fa79b21
1 changed files with 2 additions and 2 deletions

View File

@ -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");