summaryrefslogtreecommitdiff
path: root/backend/v4l.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 08:20:20 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-09-27 08:20:20 +0200
commite94622c319e4307617b202f19d3ec05b21a9bb49 (patch)
treec5ddf44352b9bd47aeb3eb432ba79638079efe25 /backend/v4l.c
parent6f2255c9648b175d51e2c8e5e9670557f9dc4ee1 (diff)
merge to 1.0.25+git20150927
Diffstat (limited to 'backend/v4l.c')
-rw-r--r--backend/v4l.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/backend/v4l.c b/backend/v4l.c
index 38595ed..519bf01 100644
--- a/backend/v4l.c
+++ b/backend/v4l.c
@@ -290,6 +290,13 @@ init_options (V4L_Scanner * s)
s->val[OPT_MODE].s = strdup (mode_list[0]);
if (!s->val[OPT_MODE].s)
return SANE_STATUS_NO_MEM;
+ s->opt[OPT_MODE].size = 1; /* '\0' */
+ for (i = 0; mode_list[i] != 0; ++i)
+ {
+ int len = strlen(mode_list[i]) + 1;
+ if (s->opt[OPT_MODE].size < len)
+ s->opt[OPT_MODE].size = len;
+ }
/* channel */
s->opt[OPT_CHANNEL].name = "channel";
@@ -305,6 +312,13 @@ init_options (V4L_Scanner * s)
return SANE_STATUS_NO_MEM;
if (s->channel[0] == 0 || s->channel[1] == 0)
s->opt[OPT_CHANNEL].cap |= SANE_CAP_INACTIVE;
+ s->opt[OPT_CHANNEL].size = 1; /* '\0' */
+ for (i = 0; s->channel[i] != 0; ++i)
+ {
+ int len = strlen(s->channel[i]) + 1;
+ if (s->opt[OPT_CHANNEL].size < len)
+ s->opt[OPT_CHANNEL].size = len;
+ }
/* "Geometry" group: */
s->opt[OPT_GEOMETRY_GROUP].title = "Geometry";