aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Winston2024-05-11 20:56:14 -0400
committerBen Winston2024-05-11 20:56:14 -0400
commita92a68cd10b4295fb5173356d711ac2e1f02d1b1 (patch)
tree15bdc6a8eec8ae886aaac43854e5fabbcc7e3d67
parent1b399ebaca063b62885943bf72d86796ebe60abf (diff)
only increment the array if we actually want to print the book
-rw-r--r--booki.c7
1 files changed, 1 insertions, 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);