about summary refs log tree commit diff
path: root/concat.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--concat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/concat.c b/concat.c
index 3417e8a..9ad8537 100644
--- a/concat.c
+++ b/concat.c
@@ -30,15 +30,13 @@ static uint32_t threadRoot(struct List thread) {
 		thread = thread.ptr[0].list;
 		if (!thread.len) errx(EX_PROTOCOL, "empty subthread");
 	}
-	if (thread.ptr[0].type != Number) errx(EX_PROTOCOL, "invalid thread root");
-	return thread.ptr[0].number;
+	return dataCheck(thread.ptr[0], Number).number;
 }
 
 void concatFetch(FILE *imap, enum Atom tag, struct List threads) {
 	fprintf(imap, "%s UID FETCH ", Atoms[tag]);
 	for (size_t i = 0; i < threads.len; ++i) {
-		if (threads.ptr[i].type != List) errx(EX_PROTOCOL, "invalid thread");
-		uint32_t root = threadRoot(threads.ptr[i].list);
+		uint32_t root = threadRoot(dataCheck(threads.ptr[i], List).list);
 		fprintf(imap, "%s%" PRIu32, (i ? "," : ""), root);
 	}
 	fprintf(imap, " (UID ENVELOPE)\r\n");