diff options
author | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-08-22 10:34:29 -0300 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2008-08-22 10:34:29 -0300 |
commit | 4d3f684d3b6ab28ec9e251fff156d0b0f53d0517 (patch) | |
tree | f82a2ae2dc042d6d1de61f62babeb8c5f28b22a1 /v4l2-apps/util/v4l2-dbg.cpp | |
parent | 87eb1f67e4981f3a09825012f16af0107a7adb45 (diff) | |
parent | b5ff2cd5cc913156858a0b15a186144f146c89d7 (diff) | |
download | mediapointer-dvb-s2-4d3f684d3b6ab28ec9e251fff156d0b0f53d0517.tar.gz mediapointer-dvb-s2-4d3f684d3b6ab28ec9e251fff156d0b0f53d0517.tar.bz2 |
merge: http://linuxtv.org/hg/~mkrufky/sms1xxx
From: Mauro Carvalho Chehab <mchehab@infradead.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'v4l2-apps/util/v4l2-dbg.cpp')
-rw-r--r-- | v4l2-apps/util/v4l2-dbg.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/v4l2-apps/util/v4l2-dbg.cpp b/v4l2-apps/util/v4l2-dbg.cpp index 8323f2120..2561f42b2 100644 --- a/v4l2-apps/util/v4l2-dbg.cpp +++ b/v4l2-apps/util/v4l2-dbg.cpp @@ -245,9 +245,9 @@ static int doioctl(int fd, int request, void *parm, const char *name) return retVal; } -static int parse_subopt(char **subs, char * const *subopts, char **value) +static int parse_subopt(char **subs, const char * const *subopts, char **value) { - int opt = getsubopt(subs, subopts, value); + int opt = getsubopt(subs, (char * const *)subopts, value); if (opt == -1) { fprintf(stderr, "Invalid suboptions specified\n"); @@ -272,7 +272,7 @@ int main(int argc, char **argv) /* command args */ int ch; - char *device = strdup("/dev/video0"); /* -d device */ + const char *device = "/dev/video0"; /* -d device */ struct v4l2_capability vcap; /* list_cap */ struct v4l2_register set_reg; struct v4l2_register get_reg; @@ -311,18 +311,20 @@ int main(int argc, char **argv) usage(); return 0; 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 OptSetRegister: subs = optarg; set_reg.match_type = V4L2_CHIP_MATCH_I2C_DRIVER; while (*subs != '\0') { - static char *const subopts[] = { + static const char * const subopts[] = { "type", "chip", "reg", @@ -352,7 +354,7 @@ int main(int argc, char **argv) subs = optarg; get_reg.match_type = V4L2_CHIP_MATCH_I2C_DRIVER; while (*subs != '\0') { - static char *const subopts[] = { + static const char * const subopts[] = { "type", "chip", "min", @@ -382,7 +384,7 @@ int main(int argc, char **argv) subs = optarg; set_reg.match_type = V4L2_CHIP_MATCH_I2C_DRIVER; while (*subs != '\0') { - static char *const subopts[] = { + static const char *const subopts[] = { "type", "chip", NULL @@ -424,7 +426,6 @@ int main(int argc, char **argv) strerror(errno)); exit(1); } - free(device); doioctl(fd, VIDIOC_QUERYCAP, &vcap, "VIDIOC_QUERYCAP"); capabilities = vcap.capabilities; |