GDataSet: silently accept NULL/0 as keys

This used to be the behaviour before we made these functions
threadsafe; keep it that way.

https://bugzilla.gnome.org/show_bug.cgi?id=737741
This commit is contained in:
Matthias Clasen 2014-10-02 14:40:16 -04:00
parent e24e89bc07
commit f6a9d04796

View File

@ -850,7 +850,6 @@ g_datalist_id_dup_data (GData **datalist,
GDataElt *data, *data_end;
g_return_val_if_fail (datalist != NULL, NULL);
g_return_val_if_fail (key_id != 0, NULL);
g_datalist_lock (datalist);
@ -1029,7 +1028,7 @@ g_datalist_get_data (GData **datalist,
data_end = data + d->len;
while (data < data_end)
{
if (strcmp (g_quark_to_string (data->key), key) == 0)
if (g_strcmp0 (g_quark_to_string (data->key), key) == 0)
{
res = data->data;
break;