int create_user(const char *name, User **user_ptr_add) {
    if (strlen(name) >= MAX_NAME - 1){ //checks if name is over 32-1 characters (-1 reserved for null terminator)
        return 2;
    }

    User *curr_user = *user_ptr_add; 
    while (curr_user != NULL){ //goes through the linked list and search for users with the same name
        curr_user = curr_user->next;
        if (strcmp(curr_user->name, name)==0){ //if a user has the same name as the requested new user, return 1
            return 1;
        }
    }
    User *new_user = (User*) malloc(sizeof(User)); 
    if(new_user == NULL){ //if malloc fails, it will return -1;
        return -1;
    }
    strcpy(new_user->name, name); //initializing the user's 
    strcpy(new_user->profile_pic, "");
    new_user->first_post = NULL;
    memset(new_user->friends, 0, sizeof(new_user->friends)); //set all the pointers in the friend array to NULL
    new_user->next = NULL;
    if (*user_ptr_add == NULL){
        *user_ptr_add = new_user;
    }
    else{
        User *curr_user2 = *user_ptr_add;
        while (curr_user2->next != NULL){
            curr_user2 = curr_user2->next;
        }
        curr_user2->next = new_user;
    }
    return 0;
}
getting segmentation error
