]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add constraint for max document length
authorBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jan 2024 18:30:15 +0000 (19:30 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Sat, 27 Jan 2024 18:30:15 +0000 (19:30 +0100)
src/kds_s2000w_net.c

index 7f62c8bfe88594be3cd17f5c42c612dcc73f1bd7..cec61fc573b4c0f0206cdeb6ededb570fb1201c3 100644 (file)
@@ -343,8 +343,11 @@ const SANE_Option_Descriptor* _sane_kds_s2000w_net_get_option_descriptor(
                        option_descriptors[option].title = "maxdocumentlength";
                        option_descriptors[option].desc = "maxdocumentlength";
                        option_descriptors[option].cap = SANE_CAP_SOFT_DETECT;
-                       option_descriptors[option].constraint_type = SANE_CONSTRAINT_NONE;
-                       option_descriptors[option].constraint.string_list = NULL;
+                       option_descriptors[option].constraint_type = SANE_CONSTRAINT_STRING_LIST;
+                       SANE_String_Const* constraint_max_document_length = malloc(sizeof(char*) * 2);
+                       constraint_max_document_length[0] = "#NoPrimaryControl#";
+                       constraint_max_document_length[1] = NULL;
+                       option_descriptors[option].constraint.string_list = constraint_max_document_length;
                        break;
                case 22:
                        option_descriptors[option].name = "scansource";