why is there a segmentation fault here?
Rule *parse_file(FILE *fp) {
    Rule *rules = NULL;
    char line[MAXLINE];
    Rule *currParent = NULL;
    while (fgets(line, sizeof(line) - 1, fp) != NULL) {
        line[strlen(line)] = '\0';
        char *token;
        if (strchr(line, '#') != NULL) {
            line[strlen(line) - strlen(strchr(line, '#'))] = '\0';
        }
        token = strtok(line, " ");
        if (token != NULL && strcmp(token, "\n") != 0) {
            char *newTarget = token;
            token = strtok(NULL, " ");
            if (strcmp(token, ":") == 0) {
                Rule *parent = create_rule(rules, newTarget);
                currParent = parent;
                while (token != NULL) {
                    create_dependancy(rules, parent, token);
                    token = strtok(NULL, " ");
                }
            }