aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-01 21:31:07 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2021-04-02 08:23:41 -0400
commit5bfad093b2fd261f37c77ea9bbff366e3f4af545 (patch)
tree531dea554698161d214780728dd243626376f413
parent6d34b0b70279bbd272ce8cee4a3f7706eb5c529e (diff)
downloadrneovim-5bfad093b2fd261f37c77ea9bbff366e3f4af545.tar.gz
rneovim-5bfad093b2fd261f37c77ea9bbff366e3f4af545.tar.bz2
rneovim-5bfad093b2fd261f37c77ea9bbff366e3f4af545.zip
clang/'Dead store': remove dead assign in msg_may_trunc
Evaluating the expression without assignment is enough.
-rw-r--r--src/nvim/message.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/message.c b/src/nvim/message.c
index dea6696f55..7c98d3c6b5 100644
--- a/src/nvim/message.c
+++ b/src/nvim/message.c
@@ -869,18 +869,18 @@ char_u *msg_trunc_attr(char_u *s, int force, int attr)
*/
char_u *msg_may_trunc(int force, char_u *s)
{
- int n;
int room;
room = (int)(Rows - cmdline_row - 1) * Columns + sc_col - 1;
if ((force || (shortmess(SHM_TRUNC) && !exmode_active))
- && (n = (int)STRLEN(s) - room) > 0) {
+ && (int)STRLEN(s) - room > 0) {
int size = vim_strsize(s);
// There may be room anyway when there are multibyte chars.
if (size <= room) {
return s;
}
+ int n;
for (n = 0; size >= room; ) {
size -= utf_ptr2cells(s + n);
n += utfc_ptr2len(s + n);