73799e084b
OBS-URL: https://build.opensuse.org/package/show/graphics/sane-backends?expand=0&rev=8106d8078f3338312e581a3565270715
37 lines
1.4 KiB
Diff
37 lines
1.4 KiB
Diff
--- a/backend/hp3900_sane.c
|
|
+++ b/backend/hp3900_sane.c
|
|
@@ -1189,6 +1189,7 @@ options_init (TScanner * scanner)
|
|
scanner->rng_vertical.quant = 1;
|
|
|
|
/* allocate option lists */
|
|
+ bknd_info (scanner);
|
|
bknd_colormodes (scanner, RTS_Debug->dev_model);
|
|
bknd_depths (scanner, RTS_Debug->dev_model);
|
|
bknd_models (scanner);
|
|
@@ -1562,6 +1563,7 @@ options_init (TScanner * scanner)
|
|
pDesc->constraint_type = SANE_CONSTRAINT_NONE;
|
|
pDesc->cap = SANE_CAP_ADVANCED | SANE_CAP_SOFT_DETECT;
|
|
pVal->s = strdup (SANE_I18N ("Unknown"));
|
|
+ pDesc->size = strlen(pVal->s) + 1;
|
|
break;
|
|
|
|
case opt_chipid:
|
|
@@ -1981,7 +1983,8 @@ option_get (TScanner * scanner, SANE_Int optid, void *result)
|
|
case opt_scantype:
|
|
case opt_model:
|
|
case opt_chipname:
|
|
- strcpy (result, scanner->aValues[optid].s);
|
|
+ strncpy (result, scanner->aValues[optid].s, scanner->aOptions[optid].size);
|
|
+ ((char*)result)[scanner->aOptions[optid].size-1] = '\0';
|
|
break;
|
|
|
|
/* scanner buttons */
|
|
@@ -2113,6 +2116,7 @@ option_set (TScanner * scanner, SANE_Int optid, void *value, SANE_Int * pInfo)
|
|
Load_Config (device);
|
|
|
|
/* update options according to selected device */
|
|
+ bknd_info (scanner);
|
|
bknd_colormodes (scanner, model);
|
|
bknd_depths (scanner, model);
|
|
bknd_resolutions (scanner, model);
|