From: Bastian Dehn Date: Sat, 3 Feb 2024 10:36:53 +0000 (+0100) Subject: fix parameters direct write X-Git-Tag: v1.0.0^2~366 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=70f47e8129bfdfbd86e4a6bd8de22fbfd1bd8ae0;p=sane-kds-s2000w-net.git fix parameters direct write --- diff --git a/src/kds_s2000w_net.c b/src/kds_s2000w_net.c index 13def75..dabebc2 100644 --- a/src/kds_s2000w_net.c +++ b/src/kds_s2000w_net.c @@ -7,14 +7,12 @@ SANE_Option_Descriptor* option_descriptors = NULL; SANE_Device* device_info = NULL; -SANE_Parameters* parameter = NULL; SANE_Status _sane_kds_s2000w_net_init(SANE_Int* version_code, SANE_Auth_Callback authorize) { *version_code = SANE_VERSION_CODE(1, 0, 0); option_descriptors = kds_s2000w_option_descriptor_init_option_descriptors(); device_info = malloc(sizeof(SANE_Device)); - parameter = malloc(sizeof(SANE_Parameters)); return SANE_STATUS_GOOD; } @@ -24,8 +22,6 @@ void _sane_kds_s2000w_net_exit(void) free(device_info); device_info = NULL; - free(parameter); - parameter = NULL; kds_s2000w_option_descriptor_free_option_descriptors(option_descriptors); } @@ -172,14 +168,13 @@ SANE_Status _sane_kds_s2000w_net_control_option(SANE_Handle handle, SANE_Status _sane_kds_s2000w_net_get_parameters(SANE_Handle handle, SANE_Parameters* params) { - parameter->format = SANE_FRAME_GRAY; - parameter->last_frame = SANE_TRUE; - parameter->bytes_per_line = 0; - parameter->pixels_per_line = 0; - parameter->lines = 0; - parameter->depth = 0; - - params = parameter; + params->format = SANE_FRAME_GRAY; + params->last_frame = SANE_TRUE; + params->bytes_per_line = 0; + params->pixels_per_line = 0; + params->lines = 0; + params->depth = 0; + return SANE_STATUS_GOOD; }