int i = 0;
int j = 0;
while (i < MAX_FRIENDS) {
    // Determine the first available slots in user1 and user2 friend lists.
    if ((curr_user1->friends)[i] == NULL) {
        while (j < MAX_FRIENDS) {
            if ((curr_user1->friends)[j] == NULL) {
                j = j + MAX_FRIENDS + 1;
            }
            j++;
            }
        i = i + MAX_FRIENDS + 1;
    }
    // Check if the users are already friends.
    else if ((curr_user1->friends)[i] == curr_user2) {
        already_friends = 1;
        i = i + MAX_FRIENDS + 1;
    }
    i++;
}
Add curr_user1 to the first available spot in the curr_user2 friends array, and vice versa.