Merge pull request #118 from twasilczyk/master
Silence false positive unaligned pointer access warningpull/119/head
commit
8991b5c47d
4
cangw.c
4
cangw.c
|
|
@ -282,6 +282,7 @@ int parse_mod(char *optarg, struct modattr *modmsg)
|
||||||
{
|
{
|
||||||
char *ptr, *nptr;
|
char *ptr, *nptr;
|
||||||
char hexdata[17] = {0};
|
char hexdata[17] = {0};
|
||||||
|
canid_t can_id;
|
||||||
|
|
||||||
ptr = optarg;
|
ptr = optarg;
|
||||||
nptr = strchr(ptr, ':');
|
nptr = strchr(ptr, ':');
|
||||||
|
|
@ -330,9 +331,10 @@ int parse_mod(char *optarg, struct modattr *modmsg)
|
||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sscanf(++ptr, "%x.%hhx.%16s", &modmsg->cf.can_id,
|
if (sscanf(++ptr, "%x.%hhx.%16s", &can_id,
|
||||||
(unsigned char *)&modmsg->cf.can_dlc, hexdata) != 3)
|
(unsigned char *)&modmsg->cf.can_dlc, hexdata) != 3)
|
||||||
return 5;
|
return 5;
|
||||||
|
modmsg->cf.can_id = can_id;
|
||||||
|
|
||||||
/* 4-bit masks can have values from 0 to 0xF */
|
/* 4-bit masks can have values from 0 to 0xF */
|
||||||
if (modmsg->cf.can_dlc > 0xF)
|
if (modmsg->cf.can_dlc > 0xF)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue