summaryrefslogtreecommitdiff
path: root/desktop/save_text.c
diff options
context:
space:
mode:
Diffstat (limited to 'desktop/save_text.c')
-rw-r--r--desktop/save_text.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/desktop/save_text.c b/desktop/save_text.c
index 4410268fb..535fec461 100644
--- a/desktop/save_text.c
+++ b/desktop/save_text.c
@@ -76,9 +76,19 @@ void save_as_text(struct content *c, char *path)
out = fopen(path, "w");
if (out) {
int res = fputs(result, out);
+
+ if (res < 0) {
+ LOG(("Warning: write failed"));
+ }
+
res = fputs("\n", out);
+ if (res < 0) {
+ LOG(("Warning: failed writing trailing newline"));
+ }
+
fclose(out);
}
+
free(result);
}