Fix binary detection bug
This commit is contained in:
parent
b247f8f827
commit
c760493f48
@ -40,7 +40,7 @@ struct filedata readfile(FILE *fp) {
|
|||||||
|
|
||||||
// guess if printable
|
// guess if printable
|
||||||
// from https://github.com/sharkdp/content_inspector/blob/master/src/lib.rs
|
// 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];
|
char *testbuf[testlen];
|
||||||
memcpy(testbuf, f.buf, testlen);
|
memcpy(testbuf, f.buf, testlen);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user