summaryrefslogtreecommitdiff
path: root/src/spons.c
diff options
context:
space:
mode:
authorTom Smeding <tom@tomsmeding.com>2024-07-21 21:21:03 +0200
committerTom Smeding <tom@tomsmeding.com>2024-07-21 21:21:03 +0200
commitff6598dbdfeb7870b84ebdb81b0cc18c3c25a475 (patch)
tree29ff6dd9b03586408979747c038974294cfecfa1 /src/spons.c
parent7b6c6ea226959cb169d24a866b068ee9e92d1473 (diff)
spons: Meer foutafhandeling
Diffstat (limited to 'src/spons.c')
-rw-r--r--src/spons.c4
1 files changed, 4 insertions, 0 deletions
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);