diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:32:49 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:32:49 +0200 |
commit | cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (patch) | |
tree | 56cb8849a5df91b19b72fd4f48c79c343cd9bc5e /backend/v4l.c | |
parent | ba8d09abe681600aad991f4a75e904615b7ed29f (diff) |
Imported Upstream version 1.0.25upstream/1.0.25
Diffstat (limited to 'backend/v4l.c')
-rw-r--r-- | backend/v4l.c | 14 |
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"; |