Please have a look at this simple code and its output :
L is supposed to be 16 when the for loop ends in both cases. I have verified this on my local g++ compiler.
Here, it stops at a random value of L in the first case, every time this code is run. It is as if the condition
L < 16 was ignored and the for loop continued until
String[L] != '_' became false.