aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-04-12 22:53:48 -0400
committerShav Kinderlehrer <[email protected]>2023-04-12 22:53:48 -0400
commitc760493f48e4f8c6fd9f3effb5082d263128548c (patch)
tree9895ddecf5f0848094351642a531772dcb3b8b9f
parentb247f8f827656462899c96422bffe1d85a6d64f6 (diff)
downloadlat-c760493f48e4f8c6fd9f3effb5082d263128548c.tar.gz
lat-c760493f48e4f8c6fd9f3effb5082d263128548c.zip
Fix binary detection bugv0.3.3
-rw-r--r--src/lib/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/file.c b/src/lib/file.c
index 494e740..72b7fac 100644
--- a/src/lib/file.c
+++ b/src/lib/file.c
@@ -40,7 +40,7 @@ struct filedata readfile(FILE *fp) {
// guess if printable
// from https://github.com/sharkdp/content_inspector/blob/master/src/lib.rs
- int testlen = 64;
+ int testlen = f.len >= 64 ? 64 : f.len;
char *testbuf[testlen];
memcpy(testbuf, f.buf, testlen);