From: Bastian Dehn Date: Tue, 23 Jan 2024 18:57:51 +0000 (+0100) Subject: add switch block for options X-Git-Tag: v1.0.0^2~469 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=2f43254441ce1c833efd192b0348d6298b0ece9b;p=sane-kds-s2000w-net.git add switch block for options --- diff --git a/src/kds_s2000w_handler.c b/src/kds_s2000w_handler.c index a6debca..0be3ea6 100644 --- a/src/kds_s2000w_handler.c +++ b/src/kds_s2000w_handler.c @@ -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)