Patch 8.2.5075

9 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 10, 2022, 9:55:45 AM6/10/22
to vim...@googlegroups.com

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 -- Br...@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 ///
Reply all
Reply to author
Forward
0 new messages