From ae7653b74cfd373dbafe84c913f8b1b5a006670d Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Wed, 15 Feb 2023 16:53:53 +0800 Subject: fix(win_update): don't use unintialized memory in edge case (#22266) This fixes two clang warnings. Using an unintialized "cursorline_fi" without assigning to it is not something that should normally happen, and in case it happens it will likely cause another redraw, but still don't use unintialized memory. --- src/nvim/drawscreen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/drawscreen.c b/src/nvim/drawscreen.c index 2c0b6ea3b0..0ac5220599 100644 --- a/src/nvim/drawscreen.c +++ b/src/nvim/drawscreen.c @@ -1552,7 +1552,7 @@ static void win_update(win_T *wp, DecorProviders *providers) wp->w_old_visual_col = 0; } - foldinfo_T cursorline_fi; + foldinfo_T cursorline_fi = { 0 }; wp->w_cursorline = win_cursorline_standout(wp) ? wp->w_cursor.lnum : 0; if (wp->w_p_cul) { // Make sure that the cursorline on a closed fold is redrawn -- cgit