Commit Diff


commit - 9dd0e5e95bed2a093939d798e0080c1451217050
commit + d4d45e4372f118778894438b90f9ef5ad70c7020
blob - 5896df56e07db2b6726a2df76859fc74bcdea11b
blob + 7bb2fcd49dd35d487dc9e0d84ae02704e298a672
--- 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;
 }