From eeabd3a8c6e904bf3e01017b60336c0063356943 Mon Sep 17 00:00:00 2001 From: Jan Edmund Lazo Date: Mon, 30 Dec 2019 16:55:46 -0500 Subject: vim-patch:8.2.0063: wrong size argument to vim_snprintf() Problem: Wrong size argument to vim_snprintf(). (Dominique Pelle) Solution: Reduce the size by the length. (related to vim/vim#5410) https://github.com/vim/vim/commit/08b28b7ad52d5ee3cb5fa5982b647e325a410484 --- src/nvim/ops.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/nvim/ops.c') diff --git a/src/nvim/ops.c b/src/nvim/ops.c index b597c5b214..6a621cdaa6 100644 --- a/src/nvim/ops.c +++ b/src/nvim/ops.c @@ -5654,7 +5654,8 @@ void cursor_pos_info(dict_T *dict) bom_count = bomb_size(); if (dict == NULL && bom_count > 0) { - vim_snprintf((char *)IObuff + STRLEN(IObuff), IOSIZE - STRLEN(IObuff), + const size_t len = STRLEN(IObuff); + vim_snprintf((char *)IObuff + len, IOSIZE - len, _("(+%" PRId64 " for BOM)"), (int64_t)bom_count); } if (dict == NULL) { -- cgit