]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
add switch block for options
authorBastian Dehn <hhaalo@arcor.de>
Tue, 23 Jan 2024 18:57:51 +0000 (19:57 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Tue, 23 Jan 2024 18:57:51 +0000 (19:57 +0100)
src/kds_s2000w_handler.c

index a6debca22c72c2b47eaf98638257a7a7f26a981b..0be3ea69a8bba22dafa87aa23ce31d263a3da5c4 100644 (file)
@@ -82,11 +82,15 @@ void kds_s2000w_handler_get_option(int option, void* value)
        if (_all_options == NULL)
                return;
 
-       json_object* config = json_object_object_get(_all_options, "Configuration");
-       int* num_options = (int*) value;
-       *num_options = 0;
-       *num_options = json_object_object_length(config);
-       *num_options++;
+       switch(option) {
+               default:
+                       json_object* config = json_object_object_get(_all_options, "Configuration");
+                       int* num_options = (int*) value;
+                       *num_options = 0;
+                       *num_options = json_object_object_length(config);
+                       *num_options++;
+                       break;
+       }
 }
 
 void kds_s2000w_handler_set_option(int option, void* value)