0

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!

https://gist.github.com/VarunHebli/85288dec508ecbfd4299ee0d74042e02

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

1

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.

1
  • 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 .