aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/ops.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/ops.c')
-rw-r--r--src/nvim/ops.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c
index 18facef13c..e6e617a419 100644
--- a/src/nvim/ops.c
+++ b/src/nvim/ops.c
@@ -3431,8 +3431,13 @@ void do_put(int regname, yankreg_T *reg, int dir, long count, int flags)
}
do {
- totlen = (size_t)(count * yanklen);
- if (totlen > 0) {
+ const long multlen = count * yanklen;
+
+ totlen = (size_t)(int)multlen;
+ if (totlen != (size_t)multlen) {
+ emsg(_(e_resulting_text_too_long));
+ break;
+ } else if (totlen > 0) {
oldp = ml_get(lnum);
if (lnum > start_lnum) {
pos_T pos = {