summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/screen.c b/src/screen.c
index 681c42b..d6a408d 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -10,9 +10,7 @@
static void *grow(struct grow_buf *b, size_t bytes)
{
if (bytes > b->cap) {
- size_t cap = b->cap ? b->cap : 256;
- while (cap < bytes)
- cap *= 2;
+ size_t cap = term_grow_cap(b->cap ? b->cap : 256, bytes);
void *data = realloc(b->data, cap);
if (!data)
return NULL;