> there was a 0xFF byte appended to the file, which I think is the EOF byte.
You're right, 0xFF would typically be the result of casting the EOF constant to a char.
Poor use of feof() can lead to that happening.
Code:
// BAD use of feof()
while ( !feof(in) ) {
ch = fgetc(in); // BAD error checking for EOF here as well.
fputc(ch,out)
}
> I have written some data to a file using fprintf...
> I need for this file to actually end in 0x2F 0x00 for the program that uses the file
It's quite hard to persuade fprintf to output '\0' characters, how are you managing that?