return NULL if attr->mask is zero
This commit is contained in:
parent
ac49a6447a
commit
63fe162101
@ -57,12 +57,18 @@ inline static AttrList *attr_list_new (gulong start,
|
|||||||
|
|
||||||
inline static MooTermTextAttr *attr_list_get_attr (AttrList *list, gulong i)
|
inline static MooTermTextAttr *attr_list_get_attr (AttrList *list, gulong i)
|
||||||
{
|
{
|
||||||
if (!list)
|
if (!list || i >= list->len)
|
||||||
return NULL;
|
{
|
||||||
else if (i >= list->len)
|
|
||||||
return NULL;
|
return NULL;
|
||||||
|
}
|
||||||
else
|
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,
|
inline static AttrList *attr_list_set_range (AttrList *list,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user