From 7217360e349ff787933d91b55efdfeb435eb45cb Mon Sep 17 00:00:00 2001 From: James McCoy Date: Mon, 6 Mar 2017 10:44:07 -0500 Subject: vim-patch:7.4.2051 Problem: No proper testing of trunc_string(). Solution: Add a unittest for message.c. https://github.com/vim/vim/commit/502ae4ba63561c98ac69af26cd9883bfd18d225f --- src/nvim/message.c | 2 +- src/nvim/version.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/message.c b/src/nvim/message.c index 699f4b87b9..57f7369e73 100644 --- a/src/nvim/message.c +++ b/src/nvim/message.c @@ -257,7 +257,7 @@ void trunc_string(char_u *s, char_u *buf, int room, int buflen) return; } n = ptr2cells(s + e); - if (len + n >= half) + if (len + n > half) break; len += n; buf[e] = s[e]; diff --git a/src/nvim/version.c b/src/nvim/version.c index 8fd9b4b74f..b755404a58 100644 --- a/src/nvim/version.c +++ b/src/nvim/version.c @@ -389,7 +389,7 @@ static int included_patches[] = { // 2054 NA // 2053 NA // 2052 NA - // 2051, + 2051, 2050, 2049, // 2048 NA -- cgit