I have run my program and it works! I get 16 .jpg files, all of which I can see when I open them. When I run check50, however it fails on jpg 000.jpg and 001.jpg through 014.jpg, but not 015.jpg?!
I get this result: https://sandbox.cs50.net/checks/b33f06a424c1459696623564c18c4566
The point at which it fails is at "TODO." and it shows "TODO" for the result. I don't understand this. Can anyone make sense of it? Does it have to do with adding the \0 like this poster: Recover creates the pictures, able to view them, but listed as jpg? in ls and check50 fails ?
I can't figure out why this is. I tried Valgrind and get 0 of 0 errors, BUT I do see the allocs and frees are not equal:
==3349== HEAP SUMMARY:
==3349== in use at exit: 352 bytes in 1 blocks
==3349== total heap usage: 17 allocs, 16 frees, 5,984 bytes allocated
==3349==
==3349== LEAK SUMMARY:
==3349== definitely lost: 0 bytes in 0 blocks
==3349== indirectly lost: 0 bytes in 0 blocks
==3349== possibly lost: 0 bytes in 0 blocks
==3349== still reachable: 352 bytes in 1 blocks
==3349== suppressed: 0 bytes in 0 blocks
==3349== Rerun with --leak-check=full to see details of leaked memory
==3349==
==3349== For counts of detected and suppressed errors, rerun with: -v
==3349== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)
It doesn't make sense to me that this error would cause the check50 to fail, but maybe I am missing something. Any help on this would be much appreciated!
Thank you all!