about summary refs log tree commit diff
path: root/edit.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--edit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/edit.c b/edit.c
index b0bdb23..a8f5d4a 100644
--- a/edit.c
+++ b/edit.c
@@ -75,7 +75,8 @@ int editReserve(struct Edit *e, size_t index, size_t count) {
 		return -1;
 	}
 	if (e->len + count > e->cap) {
-		size_t cap = (e->cap ? e->cap * 2 : 256);
+		size_t cap = (e->cap ?: 256);
+		while (cap < e->len + count) cap *= 2;
 		wchar_t *buf = realloc(e->buf, sizeof(*buf) * cap);
 		if (!buf) return -1;
 		e->buf = buf;
c7a880&follow=1'>Use time_t for save signatureJune McEnroe 2020-02-11Set self.nick to * initiallyJune McEnroe 2020-02-11Define ColorCap instead of hardcoding 100June McEnroe 2020-02-11Move hash to top of chat.hJune McEnroe 2020-02-11Move base64 out of chat.hJune McEnroe 2020-02-11Move XDG_SUBDIR out of chat.hJune McEnroe 2020-02-11Fix whois idle unit calculationJune McEnroe 2020-02-11Cast towupper to wchar_tJune McEnroe 2020-02-11Cast set but unused variables to voidJune McEnroe 2020-02-11Declare strlcatJune McEnroe 2020-02-11Check if VDSUSP existsJune McEnroe 2020-02-11Fix completeReplace iterationJune McEnroe 2020-02-11Use pkg(8) to configure on FreeBSDJune McEnroe 2020-02-11Remove legacy codeJune McEnroe 2020-02-11Add INSTALLING section to READMEJune McEnroe