]> granicus.if.org Git - vim/commitdiff
patch 8.2.4531: LGTM warnings for condition and buffer size v8.2.4531
author=?UTF-8?q?Dundar=20G=C3=B6c?= <gocdundar@gmail.com>
Wed, 9 Mar 2022 13:00:54 +0000 (13:00 +0000)
committerBram Moolenaar <Bram@vim.org>
Wed, 9 Mar 2022 13:00:54 +0000 (13:00 +0000)
Problem:    LGTM warnings for condition always true and buffer size too small.
Solution:   Remove the useless condition.  Make the buffer larger. (Goc
            Dundar, closes #9914)

src/charset.c
src/term.c
src/version.c

index 836a9f6ecf88c7ac253a995dca525fcd3a7acb9a..657ab85f4dc8a21cfa85bcdc17bdfca2197beb23 100644 (file)
@@ -558,7 +558,7 @@ transchar_nonprint(buf_T *buf, char_u *charbuf, int c)
        charbuf[1] = c ^ 0x40;          // DEL displayed as ^?
        charbuf[2] = NUL;
     }
-    else if (enc_utf8 && c >= 0x80)
+    else if (enc_utf8)
     {
        transchar_hex(charbuf, c);
     }
index 14a05de6de30107ee5bff4cd8ebcc32e3d2bf3a8..8709cd365dfb65ca7c28acff9991dfe75c6f7c43 100644 (file)
@@ -6370,7 +6370,7 @@ req_codes_from_term(void)
     static void
 req_more_codes_from_term(void)
 {
-    char       buf[11];
+    char       buf[23];  // extra size to shut up LGTM
     int                old_idx = xt_index_out;
 
     // Don't do anything when going to exit.
index 0aff73ad71922ea91ecaa3d4a93a1af363a61660..9b25ef0deb256d33d9472976ef729cb9aa307db3 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4531,
 /**/
     4530,
 /**/