running this code MAX_FRIENDS amount of times on the same user results in an additional addition and I don't know why
int make_friends(const char *name1, const char *name2, User *head) {
        if (find_user(name1, head) == NULL || find_user(name2, head) == NULL){return 4;}
        else if (strcmp(name1, name2) == 0){return 3;}
        else{
                User *first = find_user(name1, head);
                User *second = find_user(name2, head);
                int i=0, j=0;
                int val = 0;
                while ((first->friends)[i] != NULL){
                        if (strcmp(((first->friends)[i])->name, name2) == 0){val++;}
                        i++;
                }
                while ((second->friends)[j] != NULL){
                        if (strcmp(((second->friends)[j])->name, name1) == 0){val++;}
                        j++;
                }
                if (((i+1) > (MAX_FRIENDS)) || ((j+1) > (MAX_FRIENDS))){return 2;}
                else if (val == 2){return 1;}
                else {
                        printf("reached else\n");
                        (first->friends)[i] = second;
                        (second->friends)[j] = first;
                        return 0;
                }
        }
}