diff options
Diffstat (limited to 'backend/plustek.c')
| -rw-r--r-- | backend/plustek.c | 13 | 
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: | 
