It was happen for ‘end of file indicator’. That means after writing file, something write in last file for a time. I just add a condition in

if (curImg)
     fwrite(buffer, sizeof(buffer), 1, curImg);

replace by

if (curImg && !feof(file))
     fwrite(buffer, sizeof(buffer), 1, curImg);

CLICK HERE to find out more related problems solutions.

Leave a Comment

Your email address will not be published.

Scroll to Top