summaryrefslogtreecommitdiffstats
path: root/cmd-save-buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'cmd-save-buffer.c')
-rw-r--r--cmd-save-buffer.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/cmd-save-buffer.c b/cmd-save-buffer.c
index 3788fc22..f08f80c7 100644
--- a/cmd-save-buffer.c
+++ b/cmd-save-buffer.c
@@ -111,7 +111,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmd_q *cmdq)
if (fd != -1)
f = fdopen(fd, "ab");
} else {
- fd = openat(cwd, path, O_CREAT|O_RDWR, 0600);
+ fd = openat(cwd, path, O_CREAT|O_RDWR|O_TRUNC, 0600);
if (fd != -1)
f = fdopen(fd, "wb");
}
@@ -141,7 +141,6 @@ do_print:
return (CMD_RETURN_ERROR);
}
msg = NULL;
- msglen = 0;
used = 0;
while (used != pb->size) {