Fix binary printing bug
This commit is contained in:
parent
c3e8f013d2
commit
15986b04ff
@ -28,8 +28,6 @@ struct filedata readfile(FILE *fp) {
|
|||||||
die("fread");
|
die("fread");
|
||||||
}
|
}
|
||||||
|
|
||||||
f.lc = 10000;
|
|
||||||
|
|
||||||
// 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 = f.buflen >= 64 ? 64 : f.buflen;
|
int testlen = f.buflen >= 64 ? 64 : f.buflen;
|
||||||
|
@ -50,7 +50,7 @@ void run(FILE *fp, char *filename, bool tty) {
|
|||||||
free(f.lines[i].buf);
|
free(f.lines[i].buf);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
printf("%s", f.buf);
|
fwrite(f.buf, 1, f.buflen, stdout);
|
||||||
}
|
}
|
||||||
free(f.buf);
|
free(f.buf);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user