summaryrefslogtreecommitdiff
path: root/v4l2-apps/util/ivtv-ctl.c
diff options
context:
space:
mode:
Diffstat (limited to 'v4l2-apps/util/ivtv-ctl.c')
-rw-r--r--v4l2-apps/util/ivtv-ctl.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/v4l2-apps/util/ivtv-ctl.c b/v4l2-apps/util/ivtv-ctl.c
index 9d3170785..ab836e240 100644
--- a/v4l2-apps/util/ivtv-ctl.c
+++ b/v4l2-apps/util/ivtv-ctl.c
@@ -343,7 +343,7 @@ int main(int argc, char **argv)
/* bitfield for OptSetCodec */
/* command args */
- char *device = strdup("/dev/video0"); /* -d device */
+ const char *device = "/dev/video0"; /* -d device */
int ch;
int yuv_mode = 0;
struct v4l2_routing route; /* audio_route */
@@ -415,11 +415,13 @@ int main(int argc, char **argv)
break;
}
case OptSetDevice:
- device = strdup(optarg);
+ device = optarg;
if (device[0] >= '0' && device[0] <= '9' && device[1] == 0) {
+ static char newdev[20];
char dev = device[0];
- sprintf(device, "/dev/video%c", dev);
+ sprintf(newdev, "/dev/video%c", dev);
+ device = newdev;
}
break;
case OptSetAudioRoute:
@@ -524,7 +526,6 @@ int main(int argc, char **argv)
strerror(errno));
exit(1);
}
- free(device);
/* Setting Opts */