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
Oliver Hartkopp 2024-08-07 13:02:05 +02:00
parent 30b6b04053
commit b592ec5b1f
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}