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 /rss.c | |
parent | 9643e3cb444ee26088be4636ba2b753ac0166156 (diff) |
Diffstat (limited to 'rss.c')
-rw-r--r-- | rss.c | 10 |
1 files changed, 9 insertions, 1 deletions
@@ -1,4 +1,7 @@ +#include <errno.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> #include "config.h" #include "sm.h" @@ -61,7 +64,12 @@ rssexport(Document **doc, int ndoc) qsort(doc, ndoc, sizeof(*doc), (int (*)(const void *, const void *))creatcompar); - outf = xfopen(krssexport, "w"); + if (!mkparentdirs(krssexport)) + return; + if ((outf = fopen(krssexport, "w")) == NULL) { + fprintf(stderr, "%s: %s\n", krssexport, strerror(errno)); + return; + } for (j = 0; j < LEN(header); j++) xfputs(header[j], outf); for (i = 0; i < ndoc; i++) { |