Is there a segmentation fault in this
Rule *parse_file(FILE *fp) {
    // Implement this function and remove the stubbed return statement below.

    Rule *first_rule_ptr = NULL;
    Rule *last_rule_ptr = NULL;
    char str[MAXLINE];

    while (fgets(str, MAXLINE, fp) != NULL) {
        if (str[0] == ' ' || str[0] == '\t' || str[0] == '\n') {}
        else if (is_comment_or_empty(str)) {}
        else if (is_target_line(str)) {
                Rule *new_rule = init_rule(str);
                last_rule_ptr = new_rule;
                if (first_rule_ptr == NULL) {first_rule_ptr = new_rule;}
                else {insert_rule(&first_rule_ptr, &new_rule);}
        } else { // is action line
                add_actions(&last_rule_ptr, str);
        }
    }

    fseek(fp, 0, SEEK_SET);
    while (fgets(str, MAXLINE, fp) != NULL) {
        if (is_target_line(str)) {
                add_dependencies(&first_rule_ptr, str);
        }
    }

    return first_rule_ptr;
}