aboutsummaryrefslogtreecommitdiff
path: root/libbb/lineedit.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/lineedit.c')
-rw-r--r--libbb/lineedit.c7
1 files changed, 2 insertions, 5 deletions
diff --git a/libbb/lineedit.c b/libbb/lineedit.c
index 3ef47ba71..a46b5d2c4 100644
--- a/libbb/lineedit.c
+++ b/libbb/lineedit.c
@@ -400,11 +400,8 @@ static void free_tab_completion_data(void)
static void add_match(char *matched)
{
- int nm = num_matches;
- int nm1 = nm + 1;
-
- matches = xrealloc(matches, nm1 * sizeof(char *));
- matches[nm] = matched;
+ matches = xrealloc_vector(matches, 4, num_matches);
+ matches[num_matches] = matched;
num_matches++;
}