summaryrefslogtreecommitdiffstats
path: root/cmd-save-buffer.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2014-04-23 11:26:11 +0100
committerThomas Adam <thomas@xteddy.org>2014-04-23 11:26:11 +0100
commit953c3ef47a1933d38308075c1bacc7ea8d38301b (patch)
tree6484bdd51ecedbb5888717db271c151257ec87f5 /cmd-save-buffer.c
parent12e9c974fadc5ed6f0e7db10c40d5a0d55e0da8a (diff)
parent64613b9d411a7c76a50a2f9c66df345f082fce25 (diff)
Merge branch 'obsd-master'
Conflicts: Makefile tmux.1 window.c
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) {