tHandle errors on file openning - scribo - Email-based phlog generator
(HTM) git clone git://git.z3bra.org/scribo.git
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) README
(DIR) LICENSE
---
(DIR) commit 12050fd0fc8de72fb50659a4efaa8e3e7a48bf3b
(DIR) parent 0af2788d8a7a65b8628d35e0ef5e31528c807051
(HTM) Author: Willy Goiffon <dev@z3bra.org>
Date: Mon, 7 Sep 2020 17:40:09 +0200
Handle errors on file openning
Diffstat:
M scribo.c | 3 +++
1 file changed, 3 insertions(+), 0 deletions(-)
---
(DIR) diff --git a/scribo.c b/scribo.c
t@@ -101,6 +101,9 @@ main(int argc, char *argv[])
if (outfile)
out = fopen(outfile, "w");
+ if (!in || !out)
+ return -1;
+
if (parseheaders(in, &headers) < 0)
return -1;