canbusload: fix string length check for CAN FD
The CAN interface description can now have two bitrates.
Extend the length check to handle the CAN FD data bitrate correctly.
Fixes: 6382765bf6 ("canbusload: count databitrate seperately")
Signed-off-by: Oliver Hartkopp <socketcan@hartkopp.net>
pull/556/head
parent
30b6b04053
commit
b592ec5b1f
|
|
@ -309,7 +309,7 @@ int main(int argc, char **argv)
|
|||
ptr = argv[optind + i];
|
||||
|
||||
nbytes = strlen(ptr);
|
||||
if (nbytes >= (int)(IFNAMSIZ + sizeof("@1000000") + 1)) {
|
||||
if (nbytes >= (int)(IFNAMSIZ + sizeof("@1000000,2000000") + 1)) {
|
||||
printf("name of CAN device '%s' is too long!\n", ptr);
|
||||
return 1;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue