From 6634a60bf0750159ffc34bdff548fac0817e72bc Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 3 Oct 2023 21:54:19 -0400 Subject: tagcache/tagtree remove static buffer from tagcache_get_next callers can supply their own buffer Change-Id: I8996ecfb88e30926296a0cb0563cf6c46977323e --- apps/tagtree.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'apps/tagtree.c') diff --git a/apps/tagtree.c b/apps/tagtree.c index 78bf6bf255..542b0bb120 100644 --- a/apps/tagtree.c +++ b/apps/tagtree.c @@ -1448,6 +1448,8 @@ static void tcs_get_basename(struct tagcache_search *tcs, bool is_basename) static int retrieve_entries(struct tree_context *c, int offset, bool init) { + char tcs_buf[TAGCACHE_BUFSZ]; + const long tcs_bufsz = sizeof(tcs_buf); struct tagcache_search tcs; struct display_format *fmt; int i; @@ -1584,7 +1586,7 @@ static int retrieve_entries(struct tree_context *c, int offset, bool init) total_count += 2; } - while (tagcache_get_next(&tcs)) + while (tagcache_get_next(&tcs, tcs_buf, tcs_bufsz)) { if (total_count++ < offset) continue; @@ -1729,7 +1731,7 @@ entry_skip_formatter: return current_entry_count; } - while (tagcache_get_next(&tcs)) + while (tagcache_get_next(&tcs, tcs_buf, tcs_bufsz)) { if (!show_search_progress(false, total_count)) break; -- cgit v1.2.3