testj1939: fail if we use unsupported size
Currently if we set size which is more then 128 byte will silently ignore provided value and send only maximal supported size. Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>pull/121/head
parent
8991b5c47d
commit
ed5b495da6
|
|
@ -101,6 +101,8 @@ int main(int argc, char *argv[])
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 's':
|
||||||
todo_send = strtoul(optarg ?: "8", NULL, 0);
|
todo_send = strtoul(optarg ?: "8", NULL, 0);
|
||||||
|
if (todo_send > sizeof(dat))
|
||||||
|
error(1, 0, "Unsupported size. max: %i", sizeof(dat));
|
||||||
break;
|
break;
|
||||||
case 'r':
|
case 'r':
|
||||||
todo_recv = 1;
|
todo_recv = 1;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue