the function shall clear the variable n before returning.

Unless it is important that the variable n be left unchanged. One could, of course, say either "the variable n shall be left unchanged" or "the variable n shall not be changed". I see no particular reason to select one over the other.