#include <sys/time.h>
#include <sys/wait.h>
#include <string.h>
+#include <limits.h>
#include <pthread.h>
#include "citadel.h"
#include "server.h"
time(&now);
clnew->next = NULL;
clnew->chat_time = now;
- strncpy(clnew->chat_room, roomname, 19);
+ strncpy(clnew->chat_room, roomname, ROOMNAMELEN-1);
if (username)
strncpy(clnew->chat_username, username, 31);
else
char cmdbuf[256];
char *un;
char *strptr1;
- char hold_cs_room[20];
+ char hold_cs_room[ROOMNAMELEN];
int MyLastMsg, ThisLastMsg;
struct ChatLine *clptr;
struct CitContext *t_context;
strcpy(CC->chat_room, "Main room");
else
{
- strncpy(CC->chat_room, &cmdbuf[6], 20);
+ strncpy(CC->chat_room, &cmdbuf[6], ROOMNAMELEN);
}
allwrite("<joining room>",0, CC->chat_room, NULL);
cprintf("\n");
{
if ((clptr->chat_seq > MyLastMsg) && ((!clptr->chat_username[0]) || (!strncasecmp(un, clptr->chat_username, 32))))
{
- if ((!clptr->chat_room[0]) || (!strncasecmp(CC->chat_room, clptr->chat_room, 20)))
+ if ((!clptr->chat_room[0]) || (!strncasecmp(CC->chat_room, clptr->chat_room, ROOMNAMELEN)))
{
cprintf("%s\n", clptr->chat_text);
}