mirror of
https://github.com/linux-can/can-utils.git
synced 2026-08-05 06:20:00 +02:00
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>
This commit is contained in:
+1
-1
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user