the code should work as explaied in the doc:
 * Make two users friends with each other.  This is symmetric - a pointer to
 * each user must be stored in the 'friends' array of the other.
 *
 * New friends must be added in the first empty spot in the 'friends' array.
 *
 * Return:
 *   - 0 on success.
 *   - 1 if the two users are already friends.
 *   - 2 if the users are not already friends, but at least one already has
 *     MAX_FRIENDS friends.
 *   - 3 if the same user is passed in twice.
 *   - 4 if at least one user does not exist.
 *
 * Do not modify either user if the result is a failure.
 * NOTE: If multiple errors apply, return the *largest* error code that applies.
 */

will it fail?
int make_friends(const char *name1, const char *name2, User *head) {
    User *usr1 = find_user(name1, head);
    User *usr2 = find_user(name2, head);
    if(strcmp(name1, name2)==0){return 3;}
    if(usr1 == NULL || usr2 == NULL){return 4;}

    int i = 0;
    while((usr1->friends)[i] != NULL && i != MAX_FRIENDS){
        if(strcmp((usr1->friends)[i]->name, name2) == 0){
            return 1;
        }
        i ++;
    }

    int j = 0;
    while((usr2->friends)[j] != NULL && j != MAX_FRIENDS){
        if(strcmp((usr2->friends)[j]->name, name1) ==0){
            return 1;
        }
        j ++;
    }

    if(i==MAX_FRIENDS || j==MAX_FRIENDS){return 2;}
    (usr1->friends)[i] = usr2;
    (usr2->friends)[j] = usr1;
    return 0;
}