From ff6598dbdfeb7870b84ebdb81b0cc18c3c25a475 Mon Sep 17 00:00:00 2001 From: Tom Smeding Date: Sun, 21 Jul 2024 21:21:03 +0200 Subject: spons: Meer foutafhandeling --- src/spons.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/spons.c b/src/spons.c index 3dcebbc..f59bd25 100644 --- a/src/spons.c +++ b/src/spons.c @@ -51,6 +51,10 @@ int entry_spons(int argc, char **argv) { FILE *file = stdout; if (*args != NULL) { file = fopen(*args, a ? "a" : "w"); + if (!file) { + fprintf(stderr, "spons: Kan doelbestand niet openen\n"); + return 1; + } } struct filebuf *fb = stream_to_filebuf(stdin, O_NOALLOWMAP); -- cgit v1.2.3-70-g09d2