c
< 	if (row != 0)
---
> 	if (row != 0 && row <= nused)
