diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-09-19 11:44:11 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-09-19 11:44:11 +0100 |
commit | 18ee0feb5dfbe51993dc715d24cf419ac92ebf92 (patch) | |
tree | 0a51383e2d7be90622cae2058c864d3e4dbd71a8 /src/screen.c | |
parent | b2f0ca820eae50994745106d824e215d87bd7926 (diff) |
patch 9.0.0501: warning for using uninitialized value in mouse testv9.0.0501
Problem: Warning for using uninitialized value in mouse test.
Solution: Clear ScreenCols when allocating it. (Dominique Pellé)
Diffstat (limited to 'src/screen.c')
-rw-r--r-- | src/screen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/screen.c b/src/screen.c index 27f4848378..06bda0d63a 100644 --- a/src/screen.c +++ b/src/screen.c @@ -2708,7 +2708,9 @@ retry: if (enc_dbcs == DBCS_JPNU) new_ScreenLines2 = LALLOC_MULT(schar_T, (Rows + 1) * Columns); new_ScreenAttrs = LALLOC_MULT(sattr_T, (Rows + 1) * Columns); - new_ScreenCols = LALLOC_MULT(colnr_T, (Rows + 1) * Columns); + // Clear ScreenCols to avoid a warning for unitialized memory in + // jump_to_mouse(). + new_ScreenCols = LALLOC_CLEAR_MULT(colnr_T, (Rows + 1) * Columns); new_LineOffset = LALLOC_MULT(unsigned, Rows); new_LineWraps = LALLOC_MULT(char_u, Rows); new_TabPageIdxs = LALLOC_MULT(short, Columns); |