[enumerate] Fix hb_enumerate() len for step=0

This commit is contained in:
Behdad Esfahbod 2019-05-09 12:07:45 -07:00
parent 5da3c9c33f
commit 4f2ad75a83
1 changed files with 1 additions and 1 deletions

View File

@ -539,7 +539,7 @@ struct hb_counter_iter_t :
__item_t__ __item__ () const { return +v; }
__item_t__ __item_at__ (unsigned j) const { return v + j * step; }
bool __more__ () const { return v != end_; }
unsigned __len__ () const { return (end_ - v) / step; }
unsigned __len__ () const { return !step ? UINT_MAX : (end_ - v) / step; }
void __next__ () { v += step; }
void __forward__ (unsigned n) { v += n * step; }
void __prev__ () { v -= step; }