aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShav Kinderlehrer <[email protected]>2023-04-17 10:44:30 -0400
committerShav Kinderlehrer <[email protected]>2023-04-17 10:44:30 -0400
commit15986b04ff7c9a3932f9c752a727ca8af8b80d88 (patch)
tree8457794954d59ceb28b1d847ee680c3af5fc1992
parentc3e8f013d2a329bdb1984d895dc94b3793e9374a (diff)
downloadlat-15986b04ff7c9a3932f9c752a727ca8af8b80d88.tar.gz
lat-15986b04ff7c9a3932f9c752a727ca8af8b80d88.zip
Fix binary printing bugv0.7.2
-rw-r--r--src/lib/file.c2
-rw-r--r--src/main.c2
2 files changed, 1 insertions, 3 deletions
diff --git a/src/lib/file.c b/src/lib/file.c
index f8453d2..93591ab 100644
--- a/src/lib/file.c
+++ b/src/lib/file.c
@@ -28,8 +28,6 @@ struct filedata readfile(FILE *fp) {
die("fread");
}
- f.lc = 10000;
-
// guess if printable
// from https://github.com/sharkdp/content_inspector/blob/master/src/lib.rs
int testlen = f.buflen >= 64 ? 64 : f.buflen;
diff --git a/src/main.c b/src/main.c
index 9942f9e..7d0afa2 100644
--- a/src/main.c
+++ b/src/main.c
@@ -50,7 +50,7 @@ void run(FILE *fp, char *filename, bool tty) {
free(f.lines[i].buf);
}
} else {
- printf("%s", f.buf);
+ fwrite(f.buf, 1, f.buflen, stdout);
}
free(f.buf);