diff options
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)); |