Was suspecting the same thing. But I think, because C strings are null-terminated, they allow reading up to 1 byte after its end.
In your example, "%" would cause switch ('\0') which would fall in the default case.
Yeah, but that only prints an error and keeps going, so next loop it will read past the null terminator. So I think looperhacks is correct.
The function should probably return on error.
Yeah, but that only prints an error and keeps going, so next loop it will read past the null terminator. So I think looperhacks is correct.
The function should probably return on error.