diff options
author | kylo252 <59826753+kylo252@users.noreply.github.com> | 2022-05-26 04:49:25 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-05-26 10:49:25 +0800 |
commit | 7b952793d5c46e862a9cdec3d6ac4762370296ed (patch) | |
tree | 987ea7d0174b4df4a6aa19356237b08308b0e744 /src/nvim/api/vim.c | |
parent | f246a929e7abec4aba00ceb68b1492f3be5877dc (diff) | |
download | rneovim-7b952793d5c46e862a9cdec3d6ac4762370296ed.tar.gz rneovim-7b952793d5c46e862a9cdec3d6ac4762370296ed.tar.bz2 rneovim-7b952793d5c46e862a9cdec3d6ac4762370296ed.zip |
refactor: missing parenthesis may cause unexpected problems (#17443)
related vim-8.2.{4402,4639}
Diffstat (limited to 'src/nvim/api/vim.c')
-rw-r--r-- | src/nvim/api/vim.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index 7ca0912f82..dd0b75bbfb 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -1931,13 +1931,13 @@ static void write_msg(String message, bool to_err) static char out_line_buf[LINE_BUFFER_SIZE], err_line_buf[LINE_BUFFER_SIZE]; #define PUSH_CHAR(i, pos, line_buf, msg) \ - if (message.data[i] == NL || pos == LINE_BUFFER_SIZE - 1) { \ - line_buf[pos] = NUL; \ + if (message.data[i] == NL || (pos) == LINE_BUFFER_SIZE - 1) { \ + (line_buf)[pos] = NUL; \ msg(line_buf); \ - pos = 0; \ + (pos) = 0; \ continue; \ } \ - line_buf[pos++] = message.data[i]; + (line_buf)[(pos)++] = message.data[i]; no_wait_return++; for (uint32_t i = 0; i < message.size; i++) { |