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