diff options
author | Andreas Schneider <asn@cryptomilk.org> | 2023-04-21 11:13:23 +0200 |
---|---|---|
committer | Andreas Schneider <asn@cryptomilk.org> | 2023-04-21 12:14:48 +0200 |
commit | a114a21eff58492046645b052fa3f703cddc9ce8 (patch) | |
tree | b010b3928b22e006458422121d54204b5ee387d6 | |
parent | 9802de933484cc0a69ee328f3e4e6efbb83c308e (diff) | |
download | rneovim-a114a21eff58492046645b052fa3f703cddc9ce8.tar.gz rneovim-a114a21eff58492046645b052fa3f703cddc9ce8.tar.bz2 rneovim-a114a21eff58492046645b052fa3f703cddc9ce8.zip |
fix(ex_getln): initialize pointer with NULL
In function ‘cmdpreview_open_win’,
inlined from ‘cmdpreview_may_show’ at gsrc/nvim/ex_getln.c:2487:28:
gsrc/nvim/ex_getln.c:2251:16: warning: ‘cmdpreview_buf’ may be used uninitialized [-Wmaybe-uninitialized]
2251 | int result = do_buffer(DOBUF_GOTO, DOBUF_FIRST, FORWARD, cmdpreview_buf->handle, 0);
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r-- | src/nvim/ex_getln.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ex_getln.c b/src/nvim/ex_getln.c index 97343e468b..a8ac6ab439 100644 --- a/src/nvim/ex_getln.c +++ b/src/nvim/ex_getln.c @@ -2446,7 +2446,7 @@ static bool cmdpreview_may_show(CommandLineState *s) CpInfo cpinfo; bool icm_split = *p_icm == 's'; // inccommand=split - buf_T *cmdpreview_buf; + buf_T *cmdpreview_buf = NULL; win_T *cmdpreview_win = NULL; emsg_silent++; // Block error reporting as the command may be incomplete, |