int create_user(const char *name, User **user_ptr_add) {


     User *new_user = malloc(sizeof(User));
    strcpy(new_user->name, name);
    new_user->next = NULL;
    memset(new_user->friends, 0, MAX_FRIENDS * sizeof(new_user -> friends[0]));

    if(user_ptr_add == NULL){
      *user_ptr_add = new_user;
    }
    else if(strlen(name)>MAX_NAME){
        return 2;
    }
    User *curr = *user_ptr_add;
    while(curr != NULL){
        if(strcmp(curr->name, name) ==0 ){
            return 1;
        }
       curr = curr->next;
    }
    curr->next = new_user;
    return 0;

}
the linked list tail insertion is not working