diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-08-04 18:18:27 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-08-04 18:18:27 -0300 |
commit | 6eff80b62a63ef584a51445354d899d0e35046db (patch) | |
tree | a3a3db3314521713964bd636fa92e2b15670269c /v4l2-apps/util/cx18-ctl.c | |
parent | d80b9a6dbd8d4d3d0366b9ccb92e6afb51f45554 (diff) | |
parent | d1bc61a9a24dd11c7c73b4bc31aa691a69ae0dc2 (diff) | |
download | mediapointer-dvb-s2-6eff80b62a63ef584a51445354d899d0e35046db.tar.gz mediapointer-dvb-s2-6eff80b62a63ef584a51445354d899d0e35046db.tar.bz2 |
merge: http://www.linuxtv.org/hg/~hverkuil/v4l-dvb-fixes
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/util/cx18-ctl.c')
-rw-r--r-- | v4l2-apps/util/cx18-ctl.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/v4l2-apps/util/cx18-ctl.c b/v4l2-apps/util/cx18-ctl.c index 755b9437f..4081f3aef 100644 --- a/v4l2-apps/util/cx18-ctl.c +++ b/v4l2-apps/util/cx18-ctl.c @@ -267,7 +267,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 */ @@ -312,11 +312,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: @@ -410,7 +412,6 @@ int main(int argc, char **argv) strerror(errno)); exit(1); } - free(device); /* Setting Opts */ |