diff options
author | pgen <p.gen.progs@gmail.com> | 2023-03-29 23:34:23 +0200 |
---|---|---|
committer | pgen <p.gen.progs@gmail.com> | 2023-03-30 00:27:12 +0200 |
commit | dc25ac071a0414f50aa7f7e9af590b21fa3039a7 (patch) | |
tree | 733f57ff0cf4321bcb7c8e04d67bd05c74412a39 | |
parent | 6e33893fe6c64f8e095bef1f31b3032db1c3b1ed (diff) |
Fix an off-by-one error
-rw-r--r-- | smenu.c | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -10063,7 +10063,7 @@ main(int argc, char * argv[]) } /* Update the size of the longest expanded word. */ /* """"""""""""""""""""""""""""""""""""""""""""" */ - word_real_max_size = cols_real_max_size; + word_real_max_size = cols_real_max_size + 1; } else if (win.tab_mode) { @@ -10611,7 +10611,7 @@ main(int argc, char * argv[]) /* optimal but the loss is tiny and we have the guarantee that */ /* enough place will be allocated. */ /* """""""""""""""""""""""""""""""""""""""""""""""""""""""""""" */ - tmp_word = xcalloc(word_real_max_size + tab_max_size + 1, 1); + tmp_word = xcalloc(1, word_real_max_size + tab_max_size + 1); search_data.utf8_off_a = xmalloc(word_real_max_size * sizeof(long)); search_data.utf8_len_a = xmalloc(word_real_max_size * sizeof(long)); |