diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-07-21 21:21:03 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-07-21 21:21:03 +0200 |
commit | ff6598dbdfeb7870b84ebdb81b0cc18c3c25a475 (patch) | |
tree | 29ff6dd9b03586408979747c038974294cfecfa1 | |
parent | 7b6c6ea226959cb169d24a866b068ee9e92d1473 (diff) |
spons: Meer foutafhandeling
-rw-r--r-- | src/spons.c | 4 |
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); |