]> gitweb.hhaalo.de Git - sane-kds-s2000w-net.git/commitdiff
fix test alloc chars
authorBastian Dehn <hhaalo@arcor.de>
Fri, 14 Feb 2025 09:02:34 +0000 (10:02 +0100)
committerBastian Dehn <hhaalo@arcor.de>
Fri, 14 Feb 2025 09:02:34 +0000 (10:02 +0100)
tests/kds_s2000w_image_type_check_tests.c

index 197d9f60945f1257c2312e340d6a7d52e6393813..8f07c6228392f9d0e120371f8a1a4cc7fce1eab3 100644 (file)
@@ -1,4 +1,3 @@
-#include <string.h>
 #include <stdlib.h>
 #include "kds_s2000w_image_type_check_tests.h"
 #include "../src/kds_s2000w_image_type_check.h"
@@ -40,8 +39,11 @@ void kds_s2000w_image_type_check_is_tiff_false_test()
 void kds_s2000w_image_type_check_is_pnm_true_test()
 {
        blobdata* image = malloc(sizeof(blobdata));
-       image->data = strdup("P6");
-       image->size = 3;
+       image->size = 2;
+       image->data = malloc(sizeof(char) * image->size);
+       char* imagedata = (char*) image->data;
+       imagedata[0] = 'P';
+       imagedata[1] = '6';
 
        bool result = kds_s2000w_image_type_check_is_pnm(image);