summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil@xs4all.nl>2008-08-04 19:49:24 +0200
committerHans Verkuil <hverkuil@xs4all.nl>2008-08-04 19:49:24 +0200
commitd1bc61a9a24dd11c7c73b4bc31aa691a69ae0dc2 (patch)
tree11b1465452ead6f1bab7b547ed55c1b953d82fc1
parent053556a4eefa963d9b4c6dd40cbf8a51579753f1 (diff)
downloadmediapointer-dvb-s2-d1bc61a9a24dd11c7c73b4bc31aa691a69ae0dc2.tar.gz
mediapointer-dvb-s2-d1bc61a9a24dd11c7c73b4bc31aa691a69ae0dc2.tar.bz2
ivtv/cx18-ctl: fix same overrun.
From: Hans Verkuil <hverkuil@xs4all.nl> Signed-off-by: Hans Verkuil <hverkuil@xs4all.nl>
-rw-r--r--v4l2-apps/util/cx18-ctl.c9
-rw-r--r--v4l2-apps/util/ivtv-ctl.c9
2 files changed, 10 insertions, 8 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 */
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 */