diff options
-rw-r--r-- | src/tak.c | 22 |
1 files changed, 12 insertions, 10 deletions
@@ -4,7 +4,6 @@ #include <string.h> #include <unistd.h> -#include "util/map.h" #include "util/versie.h" #include "io/read_file.h" @@ -70,9 +69,7 @@ int entry_tak(int argc, char **argv) { if (*args == NULL) { struct filebuf *fb = stream_to_filebuf(stdin); - if (fb == NULL) { - return 1; - } + if (fb == NULL) goto err_stdin; process(fb); return 0; @@ -83,19 +80,24 @@ int entry_tak(int argc, char **argv) { if (!strcmp(*args, "-")) { fb = stream_to_filebuf(stdin); - if (fb == NULL) { - return 1; - } + if (fb == NULL) goto err_stdin; } - if (fb == NULL) { - fb = file_to_filebuf(*args); - } + if (fb == NULL) fb = file_to_filebuf(*args); + if (fb == NULL) goto err_file; process(fb); args++; } return 0; + +err_stdin: + fprintf(stderr, "staart: fout bij lezen van standaard invoer"); + return 1; + +err_file: +fprintf(stderr, "staart: fout bij lezen van bestand"); + return 1; } |