From c94cceea9c2262c5b2ad5f215bb9a8ae48b02764 Mon Sep 17 00:00:00 2001 From: Dimitry Andric Date: Fri, 29 Apr 2016 19:16:59 +0000 Subject: Vendor import of subversion-1.9.4. --- subversion/libsvn_subr/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'subversion/libsvn_subr/string.c') diff --git a/subversion/libsvn_subr/string.c b/subversion/libsvn_subr/string.c index 29176d6d5dc5..43a1a4ec1802 100644 --- a/subversion/libsvn_subr/string.c +++ b/subversion/libsvn_subr/string.c @@ -677,7 +677,7 @@ svn_stringbuf_remove(svn_stringbuf_t *str, { if (pos > str->len) pos = str->len; - if (pos + count > str->len) + if (count > str->len - pos) count = str->len - pos; memmove(str->data + pos, str->data + pos + count, str->len - pos - count + 1); @@ -705,7 +705,7 @@ svn_stringbuf_replace(svn_stringbuf_t *str, if (pos > str->len) pos = str->len; - if (pos + old_count > str->len) + if (old_count > str->len - pos) old_count = str->len - pos; if (old_count < new_count) -- cgit v1.2.3