From: Bastian Dehn Date: Sun, 28 Apr 2024 19:07:48 +0000 (+0200) Subject: write file name direct X-Git-Tag: v1.0.1^2~8 X-Git-Url: https://gitweb.hhaalo.de/?a=commitdiff_plain;h=51f34158f4a0989bddd67f2c1c10f5440fab28bf;p=sane-kds-s2000w-net.git write file name direct --- diff --git a/src/kds_s2000w_image_converter.c b/src/kds_s2000w_image_converter.c index 2252f80..2c2abe3 100644 --- a/src/kds_s2000w_image_converter.c +++ b/src/kds_s2000w_image_converter.c @@ -23,16 +23,11 @@ void kds_s2000w_convert_to_pnm_with_depth(blobdata* in, ExceptionInfo* exception = NULL; Image* input_image = NULL; ImageInfo* image_info = NULL; - char* streamname = NULL; - int str_length = 0; exception = AcquireExceptionInfo(); image_info = CloneImageInfo(NULL); - str_length = 10 + strlen(format); - streamname = malloc(sizeof(char) * str_length); - snprintf(streamname, str_length, "streamin.%s", format); - memcpy(image_info->filename, streamname, str_length); + sprintf(image_info->filename, "streamin.%s", format); debug_printf(DEBUG, image_info->filename); input_image = BlobToImage(image_info, in->data, in->size , exception); @@ -46,8 +41,6 @@ void kds_s2000w_convert_to_pnm_with_depth(blobdata* in, if (input_image == NULL) { DestroyImageInfo(image_info); DestroyExceptionInfo(exception); - free(streamname); - streamname = NULL; return; } @@ -65,8 +58,6 @@ void kds_s2000w_convert_to_pnm_with_depth(blobdata* in, DestroyImageInfo(image_info); DestroyImage(input_image); DestroyExceptionInfo(exception); - free(streamname); - streamname = NULL; } void kds_s2000w_convert_jpg_to_pnm_with_depth(blobdata* in, blobdata* out, int depth)