aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/insdel.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/insdel.c b/src/insdel.c
index 7b1e6b124b0..47e75298005 100644
--- a/src/insdel.c
+++ b/src/insdel.c
@@ -485,7 +485,9 @@ insert_from_buffer_1 (buf, pos, length, inherit)
485 485
486 if (pos < BUF_GPT (buf)) 486 if (pos < BUF_GPT (buf))
487 { 487 {
488 chunk = min (length, BUF_GPT (buf) - pos); 488 chunk = BUF_GPT (buf) - pos;
489 if (chunk > length)
490 chunk = length;
489 bcopy (BUF_CHAR_ADDRESS (buf, pos), GPT_ADDR, chunk); 491 bcopy (BUF_CHAR_ADDRESS (buf, pos), GPT_ADDR, chunk);
490 } 492 }
491 else 493 else