Note that it'd be better to declare the "check" variable outside of the for loop. When the compiler sees the declaration of a variable it reserves space on the stack and then sets the bytes to zero. So it's better to do it once instead of doing it each iteration.