To: vim_dev@googlegroups.com Subject: Patch 8.2.5075 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.5075 Problem: Clang gives an out of bounds warning. Solution: adjust conditional expression (John Marriott) Files: src/ui.c *** ../vim-8.2.5074/src/ui.c 2022-05-09 20:09:19.294641425 +0100 --- src/ui.c 2022-06-10 14:49:43.442390561 +0100 *************** *** 897,903 **** maxlen = inbufcount; mch_memmove(buf, inbuf, (size_t)maxlen); inbufcount -= maxlen; ! if (inbufcount) mch_memmove(inbuf, inbuf + maxlen, (size_t)inbufcount); return (int)maxlen; } --- 897,904 ---- maxlen = inbufcount; mch_memmove(buf, inbuf, (size_t)maxlen); inbufcount -= maxlen; ! // check "maxlen" to avoid clang warning ! if (inbufcount > 0 && maxlen > 0) mch_memmove(inbuf, inbuf + maxlen, (size_t)inbufcount); return (int)maxlen; } *** ../vim-8.2.5074/src/version.c 2022-06-10 00:02:05.624733616 +0100 --- src/version.c 2022-06-10 14:51:35.294375194 +0100 *************** *** 736,737 **** --- 736,739 ---- { /* Add new patch number below this line */ + /**/ + 5075, /**/ -- Dreams are free, but there's a small charge for alterations. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///