why am i getting a \n in my msg
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) {
        if (num_read == 0) {
            users[client_index].sock_fd = -1;
            return fd;
        }
        users[client_index].username = malloc(num_read + 1);
        strncpy(users[client_index].username, buf, num_read + 1);
        return 0;
    }

    if (num_read == 0 || write(fd, buf, strlen(buf)) != strlen(buf)) {
        users[client_index].sock_fd = -1;
        return fd;
    }

    char *msg = malloc(num_read + 3 + strlen(users[client_index].username));
    sprintf(msg, "%s: %s", users[client_index].username, buf);
    for (int i = 0; i < MAX_CONNECTIONS; i++) {
        if (users[i].sock_fd != -1) {
            write(users[i].sock_fd, msg, strlen(msg));
        }
    }
    free(msg);
    return 0;
}