nchan is overwritten before it is used in all cases. so is i. from clang static analyzer ok riastradh