Pasting the whole code without trying to isolate where the Segmentation fault happened is not not cool, @cooldude
Some suggestions on how to debug this nasty error:
Add a few printf("going to...\n") before important lines of code (opening file, start loop, etc) to help you pinpoint when and where the problem happened
What was he output when ...
Here's the issue:
if (cursor->next != NULL)
while (cursor->next != NULL)
The problem is that if cursor is ever null, cursor->next doesn't exist. That will cause a seg fault. The code should be using cursor, not cursor->next. It's actually failing at the end of the for loop because table is null. Keep in mind that when cursor->...