removing improper array length calculation

This bug was found using a clang build