My c code is giving unknown segmentation fault
So I am doing the CS50 practice problem of week 4. It’s about recovering a JPEG file that has been deleted so you enter the file check for 4 headers (first 3 the same and the 4th can vary but they gave you a solution) but the program is giving me a segmentation fault and I spend so much time debugging but still can’t figure it out. I’m new and any help is appreciated