No go I'm afraid
Same problem using binary mode rather than text mode
I changed the call to the cipher function so instead I just go:
Code:
out_char = in_char;
And set my input text file to say: this is a test
what I get back is a text file saying: this is a testt
ie. The last actual character from the input file gets repeated and tacked on the end of the output file.