diff --git a/programs/cmp_io.c b/programs/cmp_io.c
index 9b026343debc55ac6db8093871cb0ceb173b7eee..4f6ee25cbd0a3ee909f243722f61cc7e0275864e 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;
 		}
 	}