Off-by-one error
Off by one errors often occur with loops. If there are a number of fields, eg. in an array, and there is a loop over the array, an off-by-one error means that either there is one iteration too few to cover all elements, or one too many. In the first case, one element of the array is left out, in the second the index of the array will be outside its dimensions. The second error usually leads to an runtime error, because the program checks the size of the data structure, and sees that there are too few elements for the iteration. The first error is more problematic, because it usually is not detected. All that may point to the error is that one element is not initialized or does not have the expected value.