summaryrefslogtreecommitdiff
path: root/backend/plustek.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2020-02-02 17:14:32 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2020-02-02 17:14:32 +0100
commit5dadc28ea784db1ba1f56c2ea8618d2db67af1c8 (patch)
tree808b2499b54563b3290f34d70d159b1024310873 /backend/plustek.c
parent5bb4cf12855ec0151de15d6c5a2354ff08766957 (diff)
parent3dade5db2a37543f19f0967901d8d80a52a1e459 (diff)
Merge branch 'feature/upstream' into develop
Diffstat (limited to 'backend/plustek.c')
-rw-r--r--backend/plustek.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/backend/plustek.c b/backend/plustek.c
index e1d9e09..eaddbd3 100644
--- a/backend/plustek.c
+++ b/backend/plustek.c
@@ -1085,14 +1085,14 @@ init_options( Plustek_Scanner *s )
/* scanner buttons */
for( i = OPT_BUTTON_0; i <= OPT_BUTTON_LAST; i++ ) {
- char name [12];
- char title [128];
+ char buf [128];
- sprintf (name, "button %d", i - OPT_BUTTON_0);
- sprintf (title, "Scanner button %d", i - OPT_BUTTON_0);
+ snprintf (buf, sizeof(buf), "button %d", i - OPT_BUTTON_0);
+ s->opt[i].name = strdup(buf);
+
+ snprintf (buf, sizeof(buf), "Scanner button %d", i - OPT_BUTTON_0);
+ s->opt[i].title = strdup(buf);
- s->opt[i].name = strdup(name);
- s->opt[i].title = strdup(title);
s->opt[i].desc = SANE_I18N("This option reflects the status "
"of the scanner buttons.");
s->opt[i].type = SANE_TYPE_BOOL;
@@ -1916,6 +1916,7 @@ sane_control_option( SANE_Handle handle, SANE_Int option,
case OPT_BUTTON_0:
if(!s->calibrating)
usb_UpdateButtonStatus(s);
+ // fall through
case OPT_BUTTON_1:
case OPT_BUTTON_2:
case OPT_BUTTON_3: