From 8bc2bffda94bf2de4e8adae57b4b5597ed4e8247 Mon Sep 17 00:00:00 2001 From: ZyX Date: Mon, 23 Jan 2017 02:03:48 +0300 Subject: coverity/155512: Pass correct length to strncat() --- src/nvim/fileio.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/nvim/fileio.c b/src/nvim/fileio.c index 12206c1680..71af89b70d 100644 --- a/src/nvim/fileio.c +++ b/src/nvim/fileio.c @@ -4982,8 +4982,8 @@ buf_check_timestamp ( set_vim_var_string(VV_WARNINGMSG, tbuf, -1); if (can_reload) { if (*mesg2 != NUL) { - strncat(tbuf, "\n", tbuf_len); - strncat(tbuf, mesg2, tbuf_len); + strncat(tbuf, "\n", tbuf_len - 1); + strncat(tbuf, mesg2, tbuf_len - 1); } if (do_dialog(VIM_WARNING, (char_u *) _("Warning"), (char_u *) tbuf, (char_u *) _("&OK\n&Load File"), 1, NULL, true) == 2) { -- cgit