summaryrefslogtreecommitdiff
path: root/src/quickfix.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-07-18 22:22:39 +0200
committerBram Moolenaar <Bram@vim.org>2016-07-18 22:22:39 +0200
commit16ec3c9be3fcdc38530bddb12978bc5a7b98c0f6 (patch)
tree57999ee7e27be33c2769278f7fb14faa3a7340d9 /src/quickfix.c
parentc1fb763184c8ae82300357867fa2070aa94366e9 (diff)
downloadvim-git-16ec3c9be3fcdc38530bddb12978bc5a7b98c0f6.tar.gz
patch 7.4.2067v7.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.
Diffstat (limited to 'src/quickfix.c')
-rw-r--r--src/quickfix.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/quickfix.c b/src/quickfix.c
index 3794e6ab0..fecc2c9eb 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -2593,9 +2593,14 @@ qf_msg(qf_info_T *qi, int which, char *lead)
if (title != NULL)
{
- while (STRLEN(buf) < 34)
- STRCAT(buf, " ");
- vim_strcat(buf, title, IOSIZE);
+ size_t len = STRLEN(buf);
+
+ if (len < 34)
+ {
+ vim_memset(buf + len, ' ', 34 - len);
+ buf[34] = NUL;
+ }
+ vim_strcat(buf, (char_u *)title, IOSIZE);
}
trunc_string(buf, buf, Columns - 1, IOSIZE);
msg(buf);