summaryrefslogtreecommitdiff
path: root/subversion/libsvn_subr/string.c
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2016-04-29 19:16:59 +0000
committerDimitry Andric <dim@FreeBSD.org>2016-04-29 19:16:59 +0000
commitc94cceea9c2262c5b2ad5f215bb9a8ae48b02764 (patch)
treedbb8174cbf6f1cc45b8de8031b18adb4030509a8 /subversion/libsvn_subr/string.c
parentdc5d469d6574e9fb03bdd793658bb371315b306a (diff)
Diffstat (limited to 'subversion/libsvn_subr/string.c')
-rw-r--r--subversion/libsvn_subr/string.c4
1 files changed, 2 insertions, 2 deletions
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)