did i correctly change the code to broadcast to all connected clients?
#ifndef PORT
#define PORT 30000
#endif
#define MAX_BACKLOG 5
#define MAX_CONNECTIONS 12
#define BUF_SIZE 128

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 {
        for (int i = 0; i < MAX_CONNECTIONS - 1; i++) {
            if (users[client_index].sock_fd != -1 && client_index != i) {
                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;
}