From 3c7cef7b08c03b5bebc25d137425ef2cd6ff4472 Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Fri, 24 Sep 2021 02:49:59 -0700 Subject: fix(PVS V681): function call order is undefined https://pvs-studio.com/en/docs/warnings/v681/ --- src/nvim/buffer.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/nvim/buffer.c') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 2b5325a917..c58eb1610e 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -3112,12 +3112,13 @@ void fileinfo(int fullname, // when non-zero print full path (size_t)(IOSIZE - (p - buffer)), true); } + bool dontwrite = bt_dontwrite(curbuf); vim_snprintf_add((char *)buffer, IOSIZE, "\"%s%s%s%s%s%s", curbufIsChanged() ? (shortmess(SHM_MOD) ? " [+]" : _(" [Modified]")) : " ", - (curbuf->b_flags & BF_NOTEDITED) && !bt_dontwrite(curbuf) + (curbuf->b_flags & BF_NOTEDITED) && !dontwrite ? _("[Not edited]") : "", - (curbuf->b_flags & BF_NEW) && !bt_dontwrite(curbuf) + (curbuf->b_flags & BF_NEW) && !dontwrite ? new_file_message() : "", (curbuf->b_flags & BF_READERR) ? _("[Read errors]") : "", -- cgit