Don't recalculate the array length during the loop, use the ARRAYLEN macro and correc...