提交 c8ce9903 编写于 作者: H Hartmut Knaack 提交者: Jonathan Cameron

tools:iio:generic_buffer: catch errors for arguments conversion

Add handler to catch errors on conversion of numerical arguments.
Signed-off-by: NHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 e9e45b43
......@@ -206,13 +206,22 @@ int main(int argc, char **argv)
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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册