summaryrefslogtreecommitdiffstats
path: root/smenu.c
diff options
context:
space:
mode:
authorpgen <p.gen.progs@gmail.com>2023-03-29 23:34:23 +0200
committerpgen <p.gen.progs@gmail.com>2023-03-30 00:27:12 +0200
commitdc25ac071a0414f50aa7f7e9af590b21fa3039a7 (patch)
tree733f57ff0cf4321bcb7c8e04d67bd05c74412a39 /smenu.c
parent6e33893fe6c64f8e095bef1f31b3032db1c3b1ed (diff)
Fix an off-by-one error
Diffstat (limited to 'smenu.c')
-rw-r--r--smenu.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/smenu.c b/smenu.c
index efcd8b0..d50777a 100644
--- a/smenu.c
+++ b/smenu.c
@@ -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));