printf("Usage:\n");
printf("Common options:\n");
printf(" -d, --device=<dev> use device <dev> as the video device\n");
- printf(" if <dev> is a single digit, then /dev/video<dev> is used\n");
+ printf(" if <dev> starts with a digit, then /dev/video<dev> is used\n");
printf(" -r, --radio-device=<dev> use device <dev> as the radio device\n");
- printf(" if <dev> is a single digit, then /dev/radio<dev> is used\n");
+ printf(" if <dev> starts with a digit, then /dev/radio<dev> is used\n");
printf(" -V, --vbi-device=<dev> use device <dev> as the vbi device\n");
- printf(" if <dev> is a single digit, then /dev/vbi<dev> is used\n");
+ printf(" if <dev> starts with a digit, then /dev/vbi<dev> is used\n");
printf(" -h, --help display this help message\n");
printf(" -n, --no-warnings turn off warning messages.\n");
printf(" -T, --trace trace all called ioctls.\n");
return 0;
case OptSetDevice:
video_device = optarg;
- if (video_device[0] >= '0' && video_device[0] <= '9' && video_device[1] == 0) {
+ if (video_device[0] >= '0' && video_device[0] <= '9' && strlen(video_device) <= 3) {
static char newdev[20];
- char dev = video_device[0];
- sprintf(newdev, "/dev/video%c", dev);
+ sprintf(newdev, "/dev/video%s", video_device);
video_device = newdev;
}
break;
case OptSetRadioDevice:
radio_device = optarg;
- if (radio_device[0] >= '0' && radio_device[0] <= '9' && radio_device[1] == 0) {
+ if (radio_device[0] >= '0' && radio_device[0] <= '9' && strlen(radio_device) <= 3) {
static char newdev[20];
- char dev = radio_device[0];
- sprintf(newdev, "/dev/radio%c", dev);
+ sprintf(newdev, "/dev/radio%s", radio_device);
radio_device = newdev;
}
break;
case OptSetVbiDevice:
vbi_device = optarg;
- if (vbi_device[0] >= '0' && vbi_device[0] <= '9' && vbi_device[1] == 0) {
+ if (vbi_device[0] >= '0' && vbi_device[0] <= '9' && strlen(vbi_device) <= 3) {
static char newdev[20];
- char dev = vbi_device[0];
- sprintf(newdev, "/dev/vbi%c", dev);
+ sprintf(newdev, "/dev/vbi%s", vbi_device);
vbi_device = newdev;
}
break;
}
case OptSetDevice:
device = optarg;
- if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) {
+ if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) {
static char newdev[20];
- char dev = device[0];
- sprintf(newdev, "/dev/video%c", dev);
+ sprintf(newdev, "/dev/video%s", device);
device = newdev;
}
break;
}
case OptSetDevice:
device = optarg;
- if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) {
+ if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) {
static char newdev[20];
- char dev = device[0];
- sprintf(newdev, "/dev/video%c", dev);
+ sprintf(newdev, "/dev/video%s", device);
device = newdev;
}
break;
" set the value of the controls [VIDIOC_S_EXT_CTRLS]\n"
" -D, --info show driver info [VIDIOC_QUERYCAP]\n"
" -d, --device=<dev> use device <dev> instead of /dev/video0\n"
- " if <dev> is a single digit, then /dev/video<dev> is used\n"
+ " if <dev> starts with a digit, then /dev/video<dev> is used\n"
" -h, --help display this help message\n"
" --help-all all options\n"
" --help-io input/output options\n"
return 0;
case OptSetDevice:
device = optarg;
- if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) {
+ if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) {
static char newdev[20];
- char dev = device[0];
- sprintf(newdev, "/dev/video%c", dev);
+ sprintf(newdev, "/dev/video%s", device);
device = newdev;
}
break;
printf("Usage: v4l2-dbg [options] [values]\n"
" -D, --info Show driver info [VIDIOC_QUERYCAP]\n"
" -d, --device=<dev> Use device <dev> instead of /dev/video0\n"
- " If <dev> is a single digit, then /dev/video<dev> is used\n"
+ " If <dev> starts with a digit, then /dev/video<dev> is used\n"
" -h, --help Display this help message\n"
" --verbose Turn on verbose ioctl error reporting\n"
" -c, --chip=<chip> The chip identifier to use with other commands\n"
case OptSetDevice:
device = optarg;
- if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) {
+ if (device[0] >= '0' && device[0] <= '9' && strlen(device) <= 3) {
static char newdev[20];
- char dev = device[0];
- sprintf(newdev, "/dev/video%c", dev);
+ sprintf(newdev, "/dev/video%s", device);
device = newdev;
}
break;