Task 1: There are now two different types of input that we could receive: a username, or a message. If we have not yet received the username, then we should copy buf to username.  Otherwise, the input will be a message to write to the socket.

Did I complete task 1 properly?
int read_from(int client_index, struct sockname *users) {
    int fd = users[client_index].sock_fd;
    char buf[BUF_SIZE + 1];

    int num_read = read(fd, &buf, BUF_SIZE);
    buf[num_read] = '\0';
    if (users[client_index].username = NULL) {
        users[client_index].username = malloc(sizeof(char) * (strlen(buf)));
        strcpy(users[client_index].username, buf);
    } else {
        int num_written = write(users[client_index].sock_fd, buf, strlen(buf));
        if (num_written != strlen(buf)) {
            printf("Error");
            return -1;
        }
    }
    if (num_read == 0 || write(fd, buf, strlen(buf)) != strlen(buf)) {
        users[client_index].sock_fd = -1;
        return fd;
    }

    return 0;
}
