diff --git a/smallchat-server.c b/smallchat-server.c index 67b1589..e15d38b 100644 --- a/smallchat-server.c +++ b/smallchat-server.c @@ -82,6 +82,7 @@ struct client *createClient(int fd) { c->fd = fd; c->nick = chatMalloc(nicklen+1); memcpy(c->nick,nick,nicklen); + assert(c->fd < MAX_CLIENTS); assert(Chat->clients[c->fd] == NULL); // This should be available. Chat->clients[c->fd] = c; /* We need to update the max client set if needed. */