diff options
author | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
---|---|---|
committer | davidovski <david@davidovski.xyz> | 2022-05-31 11:05:19 +0100 |
commit | 48ca75555522716f0f686dcae3dd6cf3d8ad714d (patch) | |
tree | 00c0f58550ba4661e87376f2f02c8001c69bae44 /repo/media/v4l-utils/fix_parse_next_subopt.patch | |
parent | 871b2b573f01c1b3176a0f65458b3d281b41c437 (diff) |
removed idea of repos
Diffstat (limited to 'repo/media/v4l-utils/fix_parse_next_subopt.patch')
-rw-r--r-- | repo/media/v4l-utils/fix_parse_next_subopt.patch | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/repo/media/v4l-utils/fix_parse_next_subopt.patch b/repo/media/v4l-utils/fix_parse_next_subopt.patch deleted file mode 100644 index d4df9d4..0000000 --- a/repo/media/v4l-utils/fix_parse_next_subopt.patch +++ /dev/null @@ -1,36 +0,0 @@ -parse_next_subopt() relies on undefined behavior and only works with glibc's -implementation of getsubopt(). This fixes the issue. ---- a/utils/v4l2-ctl/v4l2-ctl-common.cpp 2021-11-08 11:23:39.079748359 +0100 -+++ b/utils/v4l2-ctl/v4l2-ctl-common.cpp 2021-11-08 11:39:49.328576794 +0100 -@@ -956,15 +956,23 @@ static bool parse_subset(char *optarg) - - static bool parse_next_subopt(char **subs, char **value) - { -- static char *const subopts[] = { -- nullptr -- }; -- int opt = getsubopt(subs, subopts, value); -+ char *start = *subs; -+ if (!start || (start[0] == '\0')) { -+ fprintf(stderr, "Missing suboption value\n"); -+ return true; -+ } -+ *value = start; - -- if (opt < 0 || *value) -- return false; -- fprintf(stderr, "Missing suboption value\n"); -- return true; -+ char *sep = std::strchr(start, ','); -+ if (sep != nullptr) { -+ *sep = '\0'; -+ *subs = sep + 1; -+ } -+ else { -+ *subs = std::strchr(start, '\0'); -+ } -+ -+ return false; - } - - void common_cmd(const std::string &media_bus_info, int ch, char *optarg) |