X-Git-Url: https://code.citadel.org/?a=blobdiff_plain;f=citadel%2Fserv_chat.c;h=f11aec85bbb83ffa5b303e58b9f848d3cd7290de;hb=ffe458c7fb6342ac60522b9750b2ba677bc4a0a8;hp=e9182d347236d3b4e52a61dba64a10f34025748f;hpb=8b88eeca49c50c4b5519b3a2861aae59cd089d73;p=citadel.git diff --git a/citadel/serv_chat.c b/citadel/serv_chat.c index e9182d347..f11aec85b 100644 --- a/citadel/serv_chat.c +++ b/citadel/serv_chat.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include "citadel.h" #include "server.h" @@ -95,7 +96,7 @@ void allwrite(char *cmdbuf, int flag, char *roomname, char *username) 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 @@ -195,7 +196,7 @@ void cmd_chat(char *argbuf) 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; @@ -308,7 +309,7 @@ void cmd_chat(char *argbuf) strcpy(CC->chat_room, "Main room"); else { - strncpy(CC->chat_room, &cmdbuf[6], 20); + strncpy(CC->chat_room, &cmdbuf[6], ROOMNAMELEN); } allwrite("",0, CC->chat_room, NULL); cprintf("\n"); @@ -337,7 +338,7 @@ void cmd_chat(char *argbuf) { 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); }