This is question is fairly common here, but I haven't seen code similar to mine. This has led me to doubt my screen thoroughly, so I come here asking for help. It doesn't throw any errors with either make or clang, so I am lost as to how to resolve this!


This is my program for your perusal. Thanking you in advance!


Look at this code:

// repeat until end of card
int block_size = 0;
unsigned char buffer[block_size];

This allocates 0 bytes to buffer. So, when the code attempts to write to buffer, there's nowhere to write to. How many bytes are supposed to be read in at a time?

No guarantees that there aren't other problems, but this should fix the seg fault.

  • Thank you kind sir! That finally helped me run this darned piece of code. 72 hours of near sleeplessness will finally end!!!
    – EMDIPablo
    Apr 5 at 16:43

You must log in to answer this question.

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