Thinking in code · Repeating
The commonest loop bug is one pass too many or too few, and it hides at the two ends of the loop.