mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
canutils/slcan: Work with CAN interfaces with names longer than 4 characters.
Signed-off-by: Carlos Sanchez <carlossanchez@geotab.com>
This commit is contained in:
parent
5585c9d347
commit
4fb47a6a6d
1 changed files with 1 additions and 2 deletions
|
|
@ -137,8 +137,7 @@ static int caninit(char *candev, int *s, struct sockaddr_can *addr,
|
|||
syslog(LOG_ERR, "Error opening CAN socket\n");
|
||||
return -1;
|
||||
}
|
||||
strncpy(ifr.ifr_name, candev, 4);
|
||||
ifr.ifr_name[4] = '\0';
|
||||
strlcpy(ifr.ifr_name, candev, IFNAMSIZ);
|
||||
ifr.ifr_ifindex = if_nametoindex(ifr.ifr_name);
|
||||
if (!ifr.ifr_ifindex)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue