You've declared a nullTerminated argument but you assume it is always true.