diff options
author | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2024-08-18 22:44:06 +0200 |
---|---|---|
committer | Lieuwe Rooijakkers <lieuwerooijakkers@gmail.com> | 2024-08-18 22:44:06 +0200 |
commit | b25cea52a0502e2841b3f3ccff1b48028754cdad (patch) | |
tree | 65a9bb5cd89ea4664bdc766f3e711038cd3efbf4 /src | |
parent | 12fb04dd944cf1bb094ac361c77d47f62b113e05 (diff) |
verbeter kleine foutjes
Diffstat (limited to 'src')
-rw-r--r-- | src/boom.c | 3 | ||||
-rw-r--r-- | src/hoofd.c | 7 | ||||
-rw-r--r-- | src/thee.c | 2 | ||||
-rw-r--r-- | src/vind.c | 8 |
4 files changed, 7 insertions, 13 deletions
@@ -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); @@ -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) { @@ -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, |