From 2eb09c826d7afba38331b4001db709df9c633894 Mon Sep 17 00:00:00 2001 From: watiko Date: Mon, 15 Feb 2016 14:17:35 +0900 Subject: vim-patch:7.4.878 #4258 Problem: Coverity error for clearing only one byte of struct. Solution: Clear the whole struct. (Dominique Pelle) https://github.com/vim/vim/commit/69b67f7e774dc212e8c97495ee81c601b8a89ac2 --- src/nvim/ex_docmd.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'src/nvim/ex_docmd.c') diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index b1d37cfb31..2d17b31f0f 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -381,15 +381,14 @@ int do_cmdline(char_u *cmdline, LineGetter fgetline, suppress_errthrow = FALSE; } - /* - * If requested, store and reset the global values controlling the - * exception handling (used when debugging). Otherwise clear it to avoid - * a bogus compiler warning when the optimizer uses inline functions... - */ - if (flags & DOCMD_EXCRESET) + // If requested, store and reset the global values controlling the + // exception handling (used when debugging). Otherwise clear it to avoid + // a bogus compiler warning when the optimizer uses inline functions... + if (flags & DOCMD_EXCRESET) { save_dbg_stuff(&debug_saved); - else - memset(&debug_saved, 0, 1); + } else { + memset(&debug_saved, 0, sizeof(debug_saved)); + } initial_trylevel = trylevel; -- cgit