From e627d79406a39f55bce5ae2729cba91e6a4a7406 Mon Sep 17 00:00:00 2001 From: Dominik Loidolt <dominik.loidolt@univie.ac.at> Date: Thu, 6 Jun 2024 16:18:54 +0200 Subject: [PATCH] Fix type in str2uint8_arr and read_file_cmp_entity function --- programs/cmp_io.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/programs/cmp_io.c b/programs/cmp_io.c index 9b02634..4f6ee25 100644 --- a/programs/cmp_io.c +++ b/programs/cmp_io.c @@ -1184,7 +1184,7 @@ static __inline ssize_t str2uint8_arr(const char *str, uint8_t *data, uint32_t b { const char *nptr = str; const char *eptr = NULL; - size_t i = 0; + uint32_t i = 0; errno = 0; @@ -1202,7 +1202,7 @@ static __inline ssize_t str2uint8_arr(const char *str, uint8_t *data, uint32_t b if (!data) /* finished counting the sample */ break; - fprintf(stderr, "%s: %s: Error: The files do not contain enough data. Expected: 0x%x, has 0x%lx.\n", + fprintf(stderr, "%s: %s: Error: The files do not contain enough data. Expected: 0x%x, has 0x%x.\n", PROGRAM_NAME, file_name, buf_size, i); return -1; } @@ -1461,7 +1461,7 @@ ssize_t read_file_cmp_entity(const char *file_name, struct cmp_entity *ent, } if (size != (ssize_t)cmp_ent_get_size(ent)) { fprintf(stderr, "%s: %s: The size of the compression entity set in the header of the compression entity is not the same size as the read-in file has. Expected: 0x%x, has 0x%lx.\n", - PROGRAM_NAME, file_name, cmp_ent_get_size(ent), (size_t)size); + PROGRAM_NAME, file_name, cmp_ent_get_size(ent), (unsigned long)size); return -1; } } -- GitLab