From a92a68cd10b4295fb5173356d711ac2e1f02d1b1 Mon Sep 17 00:00:00 2001 From: Ben Winston Date: Sat, 11 May 2024 20:56:14 -0400 Subject: only increment the array if we actually want to print the book --- booki.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/booki.c b/booki.c index 6031772..506f7c1 100644 --- a/booki.c +++ b/booki.c @@ -367,13 +367,8 @@ char** search(int argc, char* argv[]) { if (print) { print_book(*book, search_opts.show); + book_count++; } - book_count++; - } - - printf("\n--\ncount: %d\n", book_count); - for (int i = 0; i < book_count; i++) { - print_book(books[i], true); } free(data); -- cgit v1.2.3