From b74e04649168aec579183dfef70b8784d2afe993 Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Fri, 10 Jun 2022 14:52:35 +0100 Subject: 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) --- src/ui.c | 3 ++- src/version.c | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/ui.c b/src/ui.c index 08664bff6..8368c3054 100644 --- a/src/ui.c +++ b/src/ui.c @@ -897,7 +897,8 @@ read_from_input_buf(char_u *buf, long maxlen) maxlen = inbufcount; mch_memmove(buf, inbuf, (size_t)maxlen); inbufcount -= maxlen; - if (inbufcount) + // check "maxlen" to avoid clang warning + if (inbufcount > 0 && maxlen > 0) mch_memmove(inbuf, inbuf + maxlen, (size_t)inbufcount); return (int)maxlen; } diff --git a/src/version.c b/src/version.c index a2a2d756c..d86a23d56 100644 --- a/src/version.c +++ b/src/version.c @@ -734,6 +734,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ +/**/ + 5075, /**/ 5074, /**/ -- cgit v1.2.1