Fix check before a memcpy

The search_total_results address is always going to be non-zero, so the
check will always evaluate to true, and GCC is kind enough to point this
out to us.

The appropriate fix is checking if the size of the search results array
is larger than zero, and if so, copy them into the total results array.
This commit is contained in:
Emmanuele Bassi 2022-09-02 12:52:35 +01:00
parent 903c004b37
commit e08c954693

View File

@ -710,7 +710,7 @@ merge_directory_results (void)
static_total_results = g_renew (struct search_result, static_total_results, static_total_results_allocated);
}
if (static_total_results + static_total_results_size != 0)
if (static_search_results_size != 0)
memcpy (static_total_results + static_total_results_size,
static_search_results,
static_search_results_size * sizeof (struct search_result));