are these functions correct
Rule *find_rule(char *target, Rule *head) {
    if (head == NULL) {  // If linked list is empty, return NULL
        return NULL;
    }

    // Traverse the linked list
    Rule *curr = head;
    while ((curr != NULL) && (strcmp(curr->target, target) != 0)) {
        curr = curr->next_rule;
    }

    return curr;  // Return curr if found, NULL if not found
}

Rule *create_rule(char *target) {
    Rule *new_rule = malloc(sizeof(Rule));  // Allocate space for a rule
    if (new_rule == NULL) {                 // Error checking
        perror("malloc");
        exit(1);
    }

    strcpy(new_rule->target, target);  // Set the target
    new_rule->next_rule = NULL;        // Set the next_rule

    return new_rule;  // Return the new rule
}