From: Bastian Dehn Date: Sun, 26 Oct 2025 20:49:50 +0000 (+0100) Subject: fix set configuration X-Git-Tag: v1.1.18^2~1 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=93866772f1cb7f6f20f84f32e4d720c40e8bcd26;p=sane-kds-s2000w-net.git fix set configuration --- diff --git a/src/kds_s2000w_handler_opts.c b/src/kds_s2000w_handler_opts.c index dbd6b9c..898fdcd 100644 --- a/src/kds_s2000w_handler_opts.c +++ b/src/kds_s2000w_handler_opts.c @@ -169,7 +169,11 @@ void _kds_s2000w_handler_opts_set_width_or_height_min(option_descriptor_t* descr void _kds_s2000w_handler_opts_set_options(handler_t* h) { - const char* json_string = json_object_to_json_string_ext(h->scanner_config, JSON_C_TO_STRING_PLAIN); + json_object* config = json_object_new_object(); + json_object* config_value = NULL; + json_object_deep_copy(h->scanner_config, &config_value, json_c_shallow_copy_default); + json_object_object_add(config, CONFIGURATION, config_value); + const char* json_string = json_object_to_json_string_ext(config, JSON_C_TO_STRING_PLAIN); response_t* resp = kds_s2000w_client_response_init(); resp->size = sizeof(char) * strlen(json_string); resp->code = 0; @@ -181,6 +185,8 @@ void _kds_s2000w_handler_opts_set_options(handler_t* h) kds_s2000w_client_response_free(resp); resp = NULL; + json_object_put(config); + config = NULL; } void _kds_s2000w_handler_opts_load_config(handler_t* h)