From: nicm Date: Thu, 11 Feb 2021 09:03:38 +0000 (+0000) Subject: O_TRUNC is needed in case file exists. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=18dfbca446a8f70ba5f9b560b6e57130fd711a36;p=openbsd O_TRUNC is needed in case file exists. --- diff --git a/usr.bin/tmux/cmd-save-buffer.c b/usr.bin/tmux/cmd-save-buffer.c index cb968126bad..96194a5a0f8 100644 --- a/usr.bin/tmux/cmd-save-buffer.c +++ b/usr.bin/tmux/cmd-save-buffer.c @@ -1,4 +1,4 @@ -/* $OpenBSD: cmd-save-buffer.c,v 1.51 2020/07/21 05:24:33 nicm Exp $ */ +/* $OpenBSD: cmd-save-buffer.c,v 1.52 2021/02/11 09:03:38 nicm Exp $ */ /* * Copyright (c) 2009 Tiago Cunha @@ -109,7 +109,7 @@ cmd_save_buffer_exec(struct cmd *self, struct cmdq_item *item) if (args_has(args, 'a')) flags = O_APPEND; else - flags = 0; + flags = O_TRUNC; file_write(cmdq_get_client(item), path, flags, bufdata, bufsize, cmd_save_buffer_done, item); free(path);