From d0f2a6541f90cb915b0733ac188c7e0cb332e970 Mon Sep 17 00:00:00 2001 From: Lieuwe Rooijakkers Date: Mon, 19 Aug 2024 01:27:16 +0200 Subject: toilet: output of ftell is only meaningful for binary files per cppreference.com --- src/toilet.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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) { -- cgit v1.2.3-70-g09d2