Add handler to catch errors on conversion of numerical arguments.
Signed-off-by: Hartmut Knaack <knaack.h@gmx.de>
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
noevents = 1;
break;
case 'c':
+ errno = 0;
num_loops = strtoul(optarg, &dummy, 10);
+ if (errno)
+ return -errno;
break;
case 'w':
+ errno = 0;
timedelay = strtoul(optarg, &dummy, 10);
+ if (errno)
+ return -errno;
break;
case 'l':
+ errno = 0;
buf_len = strtoul(optarg, &dummy, 10);
+ if (errno)
+ return -errno;
break;
case 'g':
notrigger = 1;