From 2ef7323f265ec4b3ee186309a945b601c1e35fd7 Mon Sep 17 00:00:00 2001
From: Přemysl Janouch
Date: Sun, 10 May 2015 00:22:19 +0200
Subject: Fix completion_add_word()
---
degesch.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/degesch.c b/degesch.c
index ba7d029..cfa44a6 100644
--- a/degesch.c
+++ b/degesch.c
@@ -5193,7 +5193,8 @@ completion_add_word (struct completion *self, size_t start, size_t end)
if (!self->words)
self->words = xcalloc ((self->words_alloc = 4), sizeof *self->words);
if (self->words_len == self->words_alloc)
- self->words = xrealloc (self->words, (self->words_alloc <<= 1));
+ self->words = xreallocarray (self->words,
+ (self->words_alloc <<= 1), sizeof *self->words);
self->words[self->words_len++] = (struct completion_word) { start, end };
}
--
cgit v1.2.3-70-g09d2