summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--v4l2-apps/util/v4l2-compliance.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/v4l2-apps/util/v4l2-compliance.cpp b/v4l2-apps/util/v4l2-compliance.cpp
index 0fb333a2d..2fe5292fe 100644
--- a/v4l2-apps/util/v4l2-compliance.cpp
+++ b/v4l2-apps/util/v4l2-compliance.cpp
@@ -998,7 +998,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 */
char short_options[26 * 2 * 2 + 1];
int idx = 0;
@@ -1034,11 +1034,13 @@ int main(int argc, char **argv)
tests++;
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 ':':