int create_user(const char *name, User **user_ptr_add){
        User *temp = *user_ptr_add;
        if (strlen(name) >= MAX_NAME){
                return 2;
        } else {
                if (*user_ptr_add == NULL){
                        temp = *user_ptr_add;
                        *user_ptr_add = malloc(sizeof(User));
                        strcpy((*user_ptr_add)->name, name);
                        (*user_ptr_add)->next = NULL;
                } else {
                while ((*user_ptr_add)->next != NULL){
                        if (strcmp((*user_ptr_add)->name, name) == 0){
                                 (*user_ptr_add) = temp;
                                return 1;
                        }
                        *user_ptr_add = (*user_ptr_add)->next;
                }
                (*user_ptr_add)->next = malloc(sizeof(User));
                strcpy((*user_ptr_add)->next->name, name);
                (*user_ptr_add)->next->next = NULL;
                }
                (*user_ptr_add) = temp;
                return 0;
        }
}

keep **user_ptr_add unchanged after the function returns