From 7bbf1c5811edba6cce197d8ee5a6585c8f03b093 Mon Sep 17 00:00:00 2001 From: "C. McEnroe" Date: Fri, 10 Apr 2020 14:45:03 -0400 Subject: Use dataCheck in parsing --- concat.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'concat.c') 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"); -- cgit 1.4.1