int make_friends(const char *name1, const char *name2, User *head) {
114     if (strcmp(name1, name2) == 0){
115             return 3;
116     }
117 
118     if (find_user(name1, head) == NULL || find_user(name2, head) == NULL){
119             return 4;
120     }
121 
122     User *user1 = find_user(name1, head);
123     User **friends1 = user1->friends;
124     User *user2 = find_user(name2, head);
125     User **friends2 = user2->friends;
126     int count1 = 0;
127     int count2 = 0;
128 
129     while ((*friends1)->next != NULL){
130             if (strcmp((*friends1)->name,(*user2)->name) == 0){
131                    return 1;
132             }
133             *friends1 = (*friends1)->next;
134             count1++;
135             if (count1 > 10){
136                     return 2;
137             }
138     }
139     while ((*friends2)->next != NULL){
140             *friends2 = (*friends2)->next;
141             count2++;
142             if (count2 > 10){
143                     return 2;
144             }
145     }
146     strcpy((*friends1)->next, (*user2)->name);
147     strcpy((*friends2)->next, (*user1)->name);
148     return 0;
149 }

Make two users friends with each other.  This is symmetric - a pointer to
 98  * each user must be stored in the 'friends' array of the other.
 99  *
100  * New friends must be added in the first empty spot in the 'friends' array.
101  *
102  * Return:
103  *   - 0 on success.
104  *   - 1 if the two users are already friends.
105  *   - 2 if the users are not already friends, but at least one already has
106  *     MAX_FRIENDS friends.
107  *   - 3 if the same user is passed in twice.
108  *   - 4 if at least one user does not exist.
109  *
110  * Do not modify either user if the result is a failure.
111  * NOTE: If multiple errors apply, return the *largest* error code that applies.
