From 749e1ecfc3d333e5ec8b1a2e639da7ccb2498c34 Mon Sep 17 00:00:00 2001 From: Christos Zoulas Date: Mon, 19 Apr 2021 18:38:04 +0000 Subject: [PATCH] PR/256: mutableVoid: If the file is less than 3 bytes, use the file length to determine type --- src/encoding.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/encoding.c b/src/encoding.c index 0fb1f47b..31d4d125 100644 --- a/src/encoding.c +++ b/src/encoding.c @@ -285,7 +285,7 @@ looks_ ## NAME(const unsigned char *buf, size_t nbytes, file_unichar_t *ubuf, \ if (dist[i]) \ u++; \ } \ - if (u < 3) \ + if (u < MIN(nbytes, 3)) \ return 0; \ \ return 1; \