I'm making an XML parser, and right now I'm trying to debug it. I've narrowed the current bug down to my read_whitespace function, which is supposed to skip any whitespace.
I figured it out - it wasn't the function that was the problem, but the various while loops that checked for non-whitespace. By not moving back 1 after every while loop, the file pointer was off by a ton by the time the error was returned.