diff options
author | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:33:06 +0200 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff-webhosting.net> | 2015-10-08 12:33:06 +0200 |
commit | 24feb9f37f302c006ba51502da817325200e74d0 (patch) | |
tree | d4451782449e5fcbae9cbe3778c51a8c6cb3c36d /backend/v4l.c | |
parent | 76b69ebb381d40458339c9940135740797cbd2d4 (diff) | |
parent | cfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (diff) |
Merge tag 'upstream/1.0.25'
Upstream version 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"; |