summaryrefslogtreecommitdiffstats
path: root/posts.c
diff options
context:
space:
mode:
Diffstat (limited to 'posts.c')
-rw-r--r--posts.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/posts.c b/posts.c
index 239f118..04535b9 100644
--- a/posts.c
+++ b/posts.c
@@ -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));