セグメンテーション違反が発生し続けますが、その理由がわかりません。セグメンテーション違反がどこにあるかはわかりましたが、修正方法がわかりません。
struct node {
int line;
int count;
char* word;
struct node* next;
};
struct node* nodeGetPreviousNode (struct node* head, struct node* node)
{
//return the previous node given the node
while(((head) != NULL) ||((head)->next != node))
{
(head) = (head)->next;
}
return (head);
}