- notmuch_query_t *query = notmuch_query_create (notmuch, "");
- total += notmuch_query_count_messages (query);
+ query = notmuch_query_create (notmuch, "");
+ unsigned msg_count;
+
+ status = notmuch_query_count_messages_st (query, &msg_count);
+ if (status)
+ goto DONE;
+
+ total += msg_count;