my program works fine for the provided texts but fails check50 at handling the most basic words and every following check with the error: ... but received the following on standard error instead — /opt/sandbox50/bin/run.sh: line 31: 4640 Segmentation fault stdbuf --error=0 --output=0 "$@" Code is at: https://pastebin.com/H8UWuf44


Answered over in the subreddit, but I'll repeat it here:

It segfaults for me when I use the given small dictionary. I'd look at your check and unload functions. What happens if htable[i] is NULL, which will definitely be true with a small dictionary? You are checking while htable[i]->next or while trav->next If there is no node in that spot, trying to access its next element will crash.

You should be checking if htable[i] or trav is NULL before trying to access their ->next elements.

You must log in to answer this question.

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