TIFLAGMAX
if (allocset(&term->flags, 0, TIFLAGMAX+1, sizeof(*term->flags)) == -1)
max = TIFLAGMAX;
for (i = 0; i < TIFLAGMAX + 1; i++) {