/* Returns: the element's data, or NULL if the position is off the end of the #GSList  */
gpointer g_slist_nth_data(GSList *list, guint n)
/* Returns: the element's data, or NULL if the position is off the end of the #GSList  */
gpointer g_slist_nth_data(GSList *list, guint n)
{
  while (n-- > 0 && list)
    list = list->next;
  return list ? list->data : NULL;
}