Commit Diff


commit - 0c2c6365f8e2e5b832c9c91e6bec8f81bbe2df90
commit + f24996f19460af47ec131fd1b637b134860ae6a4
blob - f4a673f504a8157ca9bb02ecb41051044f386464
blob + a4cfe59c07a4dba1831064585fdc24322bab45f8
--- gotwebd/got_operations.c
+++ gotwebd/got_operations.c
@@ -55,12 +55,7 @@ static const struct got_error *got_gotweb_blame_cb(voi
 static int
 isbinary(const uint8_t *buf, size_t n)
 {
-	size_t i;
-
-	for (i = 0; i < n; i++)
-		if (buf[i] == 0)
-			return 1;
-	return 0;
+	return memchr(buf, '\0', n) != NULL;
 }