Running my code on small.bmp appropriately resizes it, but instead of replicating the white centre portion, it reproduces a black centre portion. Further, I still fail most of check50. Any tips on what is causing this bug?

edited out code

1 Answer 1


The biggest problem that I see is that the code skips forward across the padding in the input file while you're processing the output. This should be done one time for each line in the input file, but it's happening n times for each line because of where you placed the fseek() call. The result is that after the first line is processed, the input file is out of synch.

If this answers your question, please click on the check mark to accept. Let's keep up on forum maintenance. ;-)

  • I wish there was some way other than words that I could express my gratitude for all the help you provide here. I probably would have burned out on CS50 long ago if it wasn't for your assistance. Again, thank you so much.
    – klmo8
    Commented Mar 2, 2016 at 23:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .