From 86f76108f78ed2b94fb2ddfafcbbb06f396a0b8c Mon Sep 17 00:00:00 2001 From: lonerover Date: Wed, 18 Jan 2017 12:09:20 +0800 Subject: [PATCH] vim-patch:7.4.2067 Problem: Compiler warning for char/char_u conversion. (Tony Mechelynck) Inefficient code. Solution: Use more lines to fill with spaces. (Nikolai Pavlov) Add type cast. https://github.com/vim/vim/commit/16ec3c9be3fcdc38530bddb12978bc5a7b98c0f6 --- src/nvim/quickfix.c | 9 ++++++--- src/nvim/version.c | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index ca2b356863..9a4d413358 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -2118,10 +2118,13 @@ static void qf_msg(qf_info_T *qi, int which, char *lead) count); if (title != NULL) { - while (STRLEN(buf) < 34) { - STRCAT(buf, " "); + size_t len = STRLEN(buf); + + if (len < 34) { + memset(buf + len, ' ', 34 - len); + buf[34] = NUL; } - vim_strcat(buf, title, IOSIZE); + vim_strcat(buf, (char_u *)title, IOSIZE); } trunc_string(buf, buf, (int)Columns - 1, IOSIZE); msg(buf); diff --git a/src/nvim/version.c b/src/nvim/version.c index 0f0666ddf9..9f801be548 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -373,7 +373,7 @@ static int included_patches[] = { // 2070 NA // 2069, // 2068, - // 2067, + 2067, 2066, 2065, 2064,