Subscription *current_sub;
current_sub = sub_user->subscriptions;
while (current_sub != NULL){
Event *sub_events;
sub_events = current_sub->calendar->events;
while (sub_events != NULL){
add_event(ordered_events, od, sub_events->description, sub_events->time);
printf("added! \n");
if(sub_events ->next != NULL){
sub_events = sub_events->next;
}
}
if (current_sub->next != NULL) {
current_sub = current_sub->next;
}
}
So my loop is infinitely looping for some reason and I can't figure out why. both checks for null, and my linked lists should all terminate at some point. Is there something having to do with double while loops checking null pointers that I should be aware about?
EDIT: never mind the infinite loop is fixed. Thanks so much!
if()s are removed.