From 1a9c6854719b37f42390cbcb5670f67963c16767 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 8 Sep 2024 16:55:09 +0200 Subject: Codestijl --- src/grijp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/grijp.c b/src/grijp.c index 1a34f8a..a17e295 100644 --- a/src/grijp.c +++ b/src/grijp.c @@ -127,7 +127,7 @@ static void compile_regexps() { } } -static void printMatch(char *fname, char *line) { +static void print_match(char *fname, char *line) { if (quiet) return; if (list) { @@ -153,10 +153,10 @@ static int process(char *fname, bool isstdin) { } char *line = NULL; - size_t linen = 0; + size_t linecap = 0; ssize_t nread = 0; - while ((errno = 0, nread = getline(&line, &linen, stream)) != -1) { + while ((errno = 0, nread = getline(&line, &linecap, stream)) != -1) { for (size_t i = 0; i < npat; i++) { bool matches = false; @@ -172,7 +172,7 @@ static int process(char *fname, bool isstdin) { if (matches) { anyMatch = true; - printMatch(fname, line); + print_match(fname, line); if (list) goto done; } } -- cgit v1.2.3-70-g09d2