summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tak.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/tak.c b/src/tak.c
index e8fb817..1fc8ff5 100644
--- a/src/tak.c
+++ b/src/tak.c
@@ -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;
}