I am using external files to save data. Occasionally, when my function opens a particular file, it gets strange data out of it that was never actually in the file.

I am using local variables in my function to store the data from the file. I have also made sure that only one instance of the function can access the file at a particular time.

I can't figure out where this strange data is coming from. If you reach the end of a file it should return zero, but in this case it is returning strange numbers, like 675.794 or -.001

I have a code that tells the game to stop reading if the number does not match a certain expected number (I added numbers to the file writing sequence to do this) but it still somehow reads these strange numbers from the file.

It's as if the function is being fed numbers from some source other than the external file.

Does this sound like a known bug of some kind? Or perhaps it's a problem someone encountered before?