diff options
-rw-r--r-- | src/nvim/ops.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ops.c b/src/nvim/ops.c index 8270641256..96deae228f 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -4770,7 +4770,7 @@ int do_addsub(int op_type, pos_T *pos, int length, linenr_T Prenum1) } } - while (bits > 0) { + while (bits > 0 && i < NUMBUFLEN - 1) { buf2[i++] = ((n >> --bits) & 0x1) ? '1' : '0'; } |