logo

checksrc

Check directory for potential non-source files git clone https://anongit.hacktivis.me/git/checksrc.git
commit: 2979f91180c081b6e2e8e1f591ba21120b4a434d
parent 869a094897a90735052749b2a7509a1c03052840
Author: Haelwenn (lanodan) Monnier <contact@hacktivis.me>
Date:   Wed, 24 Sep 2025 06:30:59 +0200

Treat ^[ (0x1B) as text

Diffstat:

Mchecksrc.c3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/checksrc.c b/checksrc.c @@ -113,7 +113,8 @@ checkfile(const char *fname) continue; } - if(buf[i] < ' ') + /* control characters. Except 0x1B ('^[', ESC). With \n, \r taken care off earlier */ + if(buf[i] < ' ' && buf[i] != 0x1B) { printf("%s: binary (byte 0x%X found at position 0x%zX)\n", fname, buf[i], i); close(fd);