/*
 * Create a new user with the given name.  Insert it at the tail of the list
 * of users whose head is pointed to by *user_ptr_add.
 *
 * Return:
 *   - 0 if successful
 *   - 1 if a user by this name already exists in this list
 *   - 2 if the given name cannot fit in the 'name' array
 *       (don't forget about the null terminator)
 */
int create_user(const char *name, User **user_ptr_add) {
    // Don't add a user if their name already exists in the list but still add 
    // user in if their name doesn't fit array and their name is unique.

    // Checks if user linked list is empty or not
    if (user_ptr_add != NULL) {
        User *curr = *user_ptr_add; // Dereference so it points to a pointer of User !!
        // Step 1: Traverse through user linked list
        while (curr->next != NULL){
            if (name == curr->name){
                return 1;
            }
            curr = curr->next;
        }
        // Checks if last user has the same name as user you want to add 
        if ((char *) name != curr->name) {
            // Create new user with name
            User *new_user = (User *)malloc(sizeof(User));
            // Copy username into new_user 
            strncpy((char *) name, new_user->name, MAX_NAME - 1); 
            // sets the last user's next to point to new_user
            curr->next = new_user;
        }
        else {
            return 1;
        }
    }
    else {
        // Create new user with name
        User *new_user = (User *)malloc(sizeof(User));
        // Copy username into new_user 
        strncpy((char *) name, new_user->name, MAX_NAME - 1); 
        // sets new user to be the head of the linked list
        user_ptr_add = &new_user;
    }

    // Check length of name
    if (strlen(name) >= MAX_NAME) {
        return 2;
    }
    else{
        return 0;
    }
}

Does not have segmentation faults