mirror of
https://github.com/vim/vim.git
synced 2025-09-26 04:04:07 -04:00
patch 8.2.5075: clang gives an out of bounds warning
Problem: Clang gives an out of bounds warning. Solution: adjust conditional expression (John Marriott)
This commit is contained in:
3
src/ui.c
3
src/ui.c
@@ -897,7 +897,8 @@ read_from_input_buf(char_u *buf, long maxlen)
|
|||||||
maxlen = inbufcount;
|
maxlen = inbufcount;
|
||||||
mch_memmove(buf, inbuf, (size_t)maxlen);
|
mch_memmove(buf, inbuf, (size_t)maxlen);
|
||||||
inbufcount -= maxlen;
|
inbufcount -= maxlen;
|
||||||
if (inbufcount)
|
// check "maxlen" to avoid clang warning
|
||||||
|
if (inbufcount > 0 && maxlen > 0)
|
||||||
mch_memmove(inbuf, inbuf + maxlen, (size_t)inbufcount);
|
mch_memmove(inbuf, inbuf + maxlen, (size_t)inbufcount);
|
||||||
return (int)maxlen;
|
return (int)maxlen;
|
||||||
}
|
}
|
||||||
|
@@ -734,6 +734,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
5075,
|
||||||
/**/
|
/**/
|
||||||
5074,
|
5074,
|
||||||
/**/
|
/**/
|
||||||
|
Reference in New Issue
Block a user