My program is an 'attempt' at steganography, and i've written what i hope to be correct for the most part, although i'm having a lot of trouble with copying the picture input to picture output verbatim.
while (bytes > 0)
{
int c = fgetc(fin);
fputc(c, fout);b
bytes--;
}
it's, quite obviously, a simple while loop that occurs after i've already copied the header and encoded a simple number (my input file length) into the previous 86 bytes. it is supposed to just copy the picture verbatim from that point
but for some reason every time i run it, on the 1105th (exactly) iteration, fputc seems to put two bytes into fout, and does so every time the 'c' byte value is 10 after that. i've checked it numerously with ftell(fout) and have no idea why it either skips one byte or decides to add two identical ones (haven't been able to figure out what it's doing).
i'm fairly positive that fputc can only add one byte at a time so any help here??