summary refs log tree commit diff
path: root/imap.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--imap.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/imap.c b/imap.c
index 620e282..7d623a5 100644
--- a/imap.c
+++ b/imap.c
@@ -147,18 +147,7 @@ static struct Data parseList(FILE *imap, char close) {
 	if (*ptr) ptr++;
 	struct Data data = { .type = List };
 	while (*ptr != close) {
-		if (data.list.len == data.list.cap) {
-			if (data.list.cap) {
-				data.list.cap *= 2;
-			} else {
-				data.list.cap = 4;
-			}
-			data.list.ptr = realloc(
-				data.list.ptr, sizeof(*data.list.ptr) * data.list.cap
-			);
-			if (!data.list.ptr) err(EX_OSERR, "realloc");
-		}
-		data.list.ptr[data.list.len++] = parseData(imap);
+		listPush(&data.list, parseData(imap));
 	}
 	if (*ptr) ptr++;
 	return data;