Handle case where iterator range contains 0 elements.

This commit is contained in:
Ulrich Czekalla 2004-05-11 22:16:54 +00:00 committed by Alexandre Julliard
parent 04869eb658
commit fc9be6a599
1 changed files with 7 additions and 2 deletions

View File

@ -1113,8 +1113,13 @@ static RANGE iterator_range(ITERATOR* i)
if (!i->ranges) return i->range;
range.lower = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, 0)).lower;
range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, DPA_GetPtrCount(i->ranges->hdpa) - 1)).upper;
if (DPA_GetPtrCount(i->ranges->hdpa) > 0)
{
range.lower = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, 0)).lower;
range.upper = (*(RANGE*)DPA_GetPtr(i->ranges->hdpa, DPA_GetPtrCount(i->ranges->hdpa) - 1)).upper;
}
else range.lower = range.upper = 0;
return range;
}