Commit b7d06e0dc98a0b774db6e54272a38ed0583b3d4d

Guillem Jover 2021-02-19T23:56:07

Fix signedness type mismatch comparisons Change the variable type or use a cast. Warned-by: gcc

diff --git a/src/helper.c b/src/helper.c
index 91a8973..04eae22 100644
--- a/src/helper.c
+++ b/src/helper.c
@@ -74,7 +74,7 @@ HASHFileChunk(const char *filename, char *buf, off_t off, off_t len)
 		return (NULL);
 	}
 
-	while ((nr = read(fd, buffer, MIN(sizeof(buffer), len))) > 0) {
+	while ((nr = read(fd, buffer, MIN((off_t)sizeof(buffer), len))) > 0) {
 		HASHUpdate(&ctx, buffer, (size_t)nr);
 		if (len > 0 && (len -= nr) == 0)
 			break;
diff --git a/test/test.h b/test/test.h
index e937ea3..eac63ec 100644
--- a/test/test.h
+++ b/test/test.h
@@ -44,7 +44,7 @@ hexchar2bin(int c)
 static void
 hex2bin(uint8_t *bin, const char *str, size_t bin_len)
 {
-	int i;
+	size_t i;
 
 	for (i = 0; i < bin_len; i++)
 		bin[i] = hexchar2bin(str[i * 2]) << 4 |