summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-08-19 01:27:16 +0200
committerLieuwe Rooijakkers <lieuwerooijakkers@gmail.com>2024-08-19 01:27:36 +0200
commitd0f2a6541f90cb915b0733ac188c7e0cb332e970 (patch)
tree192611f1230b53eaed5ac59639178c73e9878cc8
parent52f28c38d0d1d7d6036495b3ecadf3cd82dd1e50 (diff)
toilet: output of ftell is only meaningful for binary files
per cppreference.com
-rw-r--r--src/toilet.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/toilet.c b/src/toilet.c
index 74cafb2..aab9dcc 100644
--- a/src/toilet.c
+++ b/src/toilet.c
@@ -143,7 +143,7 @@ static size_t get_count(enum MODE mode, char *fname, FILE *f) {
}
static int process(char *fname, bool isstdin) {
- FILE *f = isstdin ? stdin : fopen(fname, "r");
+ FILE *f = isstdin ? stdin : fopen(fname, "rb");
for (enum MODE mode = 1; mode <= M_BYTES; mode <<= 1) {
if (mode & modeMap) {