mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 23:46:17 +01:00
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:
parent
903c004b37
commit
e08c954693
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user