aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cmds.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/cmds.c b/src/cmds.c
index 5b98a09fda9..c342cd88bd8 100644
--- a/src/cmds.c
+++ b/src/cmds.c
@@ -451,7 +451,10 @@ internal_self_insert (int c, EMACS_INT n)
451 string = concat2 (string, tem); 451 string = concat2 (string, tem);
452 } 452 }
453 453
454 replace_range (PT, PT + chars_to_delete, string, 1, 1, 1, 0); 454 ptrdiff_t to;
455 if (INT_ADD_WRAPV (PT, chars_to_delete, &to))
456 to = PTRDIFF_MAX;
457 replace_range (PT, to, string, 1, 1, 1, 0);
455 Fforward_char (make_fixnum (n)); 458 Fforward_char (make_fixnum (n));
456 } 459 }
457 else if (n > 1) 460 else if (n > 1)