don't simply crash if any of the pointer args are NULL. Instead,
2007-09-15 Michael Natterer <mitch@imendio.com> * gtk/gtkselection.c (gtk_target_list_find): don't simply crash if any of the pointer args are NULL. Instead, g_return_if_fail() on "list != NULL" and allow to pass NULL as return location for "info". svn path=/trunk/; revision=18831
This commit is contained in:

committed by
Michael Natterer

parent
5d49282441
commit
95116d0f1c
@ -1,3 +1,9 @@
|
|||||||
|
2007-09-15 Michael Natterer <mitch@imendio.com>
|
||||||
|
|
||||||
|
* gtk/gtkselection.c (gtk_target_list_find): don't simply crash if
|
||||||
|
any of the pointer args are NULL. Instead, g_return_if_fail() on
|
||||||
|
"list != NULL" and allow to pass NULL as return location for "info".
|
||||||
|
|
||||||
2007-09-14 Emmanuele Bassi <ebassi@gnome.org>
|
2007-09-14 Emmanuele Bassi <ebassi@gnome.org>
|
||||||
|
|
||||||
* gtk/gtkrecentaction.c:
|
* gtk/gtkrecentaction.c:
|
||||||
|
@ -530,10 +530,11 @@ gtk_target_list_remove (GtkTargetList *list,
|
|||||||
* gtk_target_list_find:
|
* gtk_target_list_find:
|
||||||
* @list: a #GtkTargetList
|
* @list: a #GtkTargetList
|
||||||
* @target: an interned atom representing the target to search for
|
* @target: an interned atom representing the target to search for
|
||||||
* @info: a pointer to the location to store application info for target
|
* @info: a pointer to the location to store application info for target,
|
||||||
*
|
* or %NULL
|
||||||
|
*
|
||||||
* Looks up a given target in a #GtkTargetList.
|
* Looks up a given target in a #GtkTargetList.
|
||||||
*
|
*
|
||||||
* Return value: %TRUE if the target was found, otherwise %FALSE
|
* Return value: %TRUE if the target was found, otherwise %FALSE
|
||||||
**/
|
**/
|
||||||
gboolean
|
gboolean
|
||||||
@ -541,16 +542,23 @@ gtk_target_list_find (GtkTargetList *list,
|
|||||||
GdkAtom target,
|
GdkAtom target,
|
||||||
guint *info)
|
guint *info)
|
||||||
{
|
{
|
||||||
GList *tmp_list = list->list;
|
GList *tmp_list;
|
||||||
|
|
||||||
|
g_return_if_fail (list != NULL);
|
||||||
|
|
||||||
|
tmp_list = list->list;
|
||||||
while (tmp_list)
|
while (tmp_list)
|
||||||
{
|
{
|
||||||
GtkTargetPair *pair = tmp_list->data;
|
GtkTargetPair *pair = tmp_list->data;
|
||||||
|
|
||||||
if (pair->target == target)
|
if (pair->target == target)
|
||||||
{
|
{
|
||||||
*info = pair->info;
|
if (info)
|
||||||
|
*info = pair->info;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
tmp_list = tmp_list->next;
|
tmp_list = tmp_list->next;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user