gactionmap: Check for < 0 in g_action_map_add_action_entries()

Assume that all negative values mean `NULL` terminated. Everything else
will cause a disaster anyway.
This commit is contained in:
Guido Günther 2023-05-24 16:00:30 +02:00
parent ecbe360a38
commit 596fec811d

View File

@ -222,7 +222,7 @@ g_action_map_add_action_entries (GActionMap *action_map,
g_return_if_fail (G_IS_ACTION_MAP (action_map));
g_return_if_fail (entries != NULL || n_entries == 0);
for (i = 0; n_entries == -1 ? entries[i].name != NULL : i < n_entries; i++)
for (i = 0; n_entries < 0 ? entries[i].name != NULL : i < n_entries; i++)
{
const GActionEntry *entry = &entries[i];
const GVariantType *parameter_type;