return NULL if attr->mask is zero

master
Yevgen Muntyan 2005-07-03 08:28:59 +00:00
parent ac49a6447a
commit 63fe162101
1 changed files with 10 additions and 4 deletions

View File

@ -57,12 +57,18 @@ inline static AttrList *attr_list_new (gulong start,
inline static MooTermTextAttr *attr_list_get_attr (AttrList *list, gulong i)
{
if (!list)
return NULL;
else if (i >= list->len)
if (!list || i >= list->len)
{
return NULL;
}
else
return &g_array_index (list, MooTermTextAttr, i);
{
MooTermTextAttr *attr = &g_array_index (list, MooTermTextAttr, i);
if (attr->mask)
return attr;
else
return NULL;
}
}
inline static AttrList *attr_list_set_range (AttrList *list,