Make sure settextindex clamps correctly on INDEX_MAX input