From b25cea52a0502e2841b3f3ccff1b48028754cdad Mon Sep 17 00:00:00 2001 From: Lieuwe Rooijakkers Date: Sun, 18 Aug 2024 22:44:06 +0200 Subject: verbeter kleine foutjes --- src/boom.c | 3 +-- src/hoofd.c | 7 +------ src/thee.c | 2 +- src/vind.c | 8 ++++---- 4 files changed, 7 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/boom.c b/src/boom.c index 9611e55..c1bd164 100644 --- a/src/boom.c +++ b/src/boom.c @@ -19,14 +19,13 @@ static bool dirs_only = false; static void usage(FILE *f) { fprintf(f, - "Gebruik: boom [-thV] [STARTPUNTEN]...\n" + "Gebruik: boom [OPTIES]... [STARTPUNTEN]...\n" "\n" "Geef inhoud van mapjes weer in een boom-achtig formaat.\n" "\n" " -a Alle bestanden worden weergegeven, ookal beginnen ze met een puntje\n" " -m Geef alleen mapjes weer\n" " -d Maximale diepte\n" - " -o Omvang van n beten (+, - voor meer of minder)\n" " -h Toon deze hulptekst\n" " -V Toon versienummer\n"); } diff --git a/src/hoofd.c b/src/hoofd.c index 596461a..aa7e6ab 100644 --- a/src/hoofd.c +++ b/src/hoofd.c @@ -62,12 +62,7 @@ static char** parse_options(int argc, char **argv, int *n, int *c) { } static int process(char *fname, bool isstdin) { - FILE *stream = NULL; - if (isstdin) { - stream = stdin; - } else { - stream = fopen(fname, "rb"); - } + FILE *stream = isstdin ? stdin : fopen(fname, "rb"); if (gc != -1) { char *buf = calloc(gc, 1); diff --git a/src/thee.c b/src/thee.c index a82a290..6e29288 100644 --- a/src/thee.c +++ b/src/thee.c @@ -47,7 +47,7 @@ int entry_thee(int argc, char **argv) { struct filebuf *fb = stream_to_filebuf(stdin, O_NOALLOWMAP); - //process(fb, stdout); + process(fb, stdout); for (int i = 0; args[i]; i++) { FILE *file = fopen(args[i], opts.append ? "a" : "w"); if (!file) { diff --git a/src/vind.c b/src/vind.c index f2e7e52..5e5ba90 100644 --- a/src/vind.c +++ b/src/vind.c @@ -12,11 +12,11 @@ #include "util/versie.h" -int ftmap = 0; -int max_depth = -1; +static int ftmap = 0; +static int max_depth = -1; -ssize_t min_size = 0; -ssize_t max_size = SSIZE_MAX; +static ssize_t min_size = 0; +static ssize_t max_size = SSIZE_MAX; static void usage(FILE *f) { fprintf(f, -- cgit v1.2.3-70-g09d2