diff options
author | Erik K <erikk@previousplan.org> | 2022-05-26 16:31:27 +0000 |
---|---|---|
committer | Erik K <erikk@previousplan.org> | 2022-05-26 16:31:27 +0000 |
commit | 61d75021c8a1180d2b591e70c783bd2eb21188bd (patch) | |
tree | e5401f7c66da4b41eb1bc7f01a8e98a38f8ceae8 /posts.c | |
parent | 9643e3cb444ee26088be4636ba2b753ac0166156 (diff) |
Diffstat (limited to 'posts.c')
-rw-r--r-- | posts.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,5 @@ -#include <stdlib.h> +#include <errno.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> @@ -71,7 +72,12 @@ href=\"mailto:erikk@previousplan.org\">erikk@previousplan.org</a> \ qsort(doc, ndoc, sizeof(*doc), (int (*)(const void *, const void *))creatcompar); - outf = xfopen(kpostsexport, "w"); + if (!mkparentdirs(kpostsexport)) + return; + if ((outf = fopen(kpostsexport, "w")) == NULL) { + fprintf(stderr, "%s: %s\n", kpostsexport, strerror(errno)); + return; + } xfputs(header, outf); for (i = 0; i < ndoc; i++) { my_strlcpy(title, doc[i]->title, sizeof(title)); |