summaryrefslogtreecommitdiff
path: root/src/map/chat.c
diff options
context:
space:
mode:
authoramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-07 18:00:13 +0000
committeramber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-07 18:00:13 +0000
commit1a348ede4934a1ba78f337ee1dffe11a699f4bef (patch)
tree883d4c1ae282fb67e1720f81c20f564499298ff4 /src/map/chat.c
parent7cb0d361f1b4260b47ab1da99224332947320553 (diff)
parenta6cd6538e4271ea08dc86803e8b7e8c8f235960b (diff)
downloadhercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.tar.gz
hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.tar.bz2
hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.tar.xz
hercules-1a348ede4934a1ba78f337ee1dffe11a699f4bef.zip
branch for major stability breakage
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@1440 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chat.c')
-rw-r--r--src/map/chat.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/map/chat.c b/src/map/chat.c
index 75788f03b..3bd29fec3 100644
--- a/src/map/chat.c
+++ b/src/map/chat.c
@@ -29,7 +29,7 @@ int chat_createchat(struct map_session_data *sd,int limit,int pub,char* pass,cha
nullpo_retr(0, sd);
- cd = aCalloc(1,sizeof(struct chat_data));
+ cd = (struct chat_data *) aCalloc(1,sizeof(struct chat_data));
cd->limit = limit;
cd->pub = pub;
@@ -49,7 +49,7 @@ int chat_createchat(struct map_session_data *sd,int limit,int pub,char* pass,cha
cd->bl.id = map_addobject(&cd->bl);
if(cd->bl.id==0){
clif_createchat(sd,1);
- free(cd);
+ aFree(cd);
return 0;
}
pc_setchatid(sd,cd->bl.id);
@@ -78,11 +78,11 @@ int chat_joinchat(struct map_session_data *sd,int chatid,char* pass)
clif_joinchatfail(sd,0);
return 0;
}
- if(cd->pub==0 && strncmp(pass,cd->pass,8)){
+ if(cd->pub==0 && strncmp(pass,(char *) cd->pass,8)){
clif_joinchatfail(sd,1);
return 0;
}
- if(chatid == sd->chatID) //Double Chat fix by Alex14, thx CHaNGeTe
+ if(chatid == (int)sd->chatID) //Double Chat fix by Alex14, thx CHaNGeTe
{
clif_joinchatfail(sd,1);
return 0;
@@ -268,14 +268,14 @@ int chat_createnpcchat(struct npc_data *nd,int limit,int pub,int trigger,char* t
nullpo_retr(1, nd);
- cd = aCalloc(1,sizeof(struct chat_data));
+ cd = (struct chat_data *) aCalloc(1,sizeof(struct chat_data));
cd->limit = cd->trigger = limit;
if(trigger>0)
cd->trigger = trigger;
cd->pub = pub;
cd->users = 0;
- memcpy(cd->pass,"",8);
+ memcpy(cd->pass,"",1);
if(titlelen>=sizeof(cd->title)-1) titlelen=sizeof(cd->title)-1;
memcpy(cd->title,title,titlelen);
cd->title[titlelen]=0;
@@ -286,11 +286,11 @@ int chat_createnpcchat(struct npc_data *nd,int limit,int pub,int trigger,char* t
cd->bl.type = BL_CHAT;
cd->owner_ = (struct block_list *)nd;
cd->owner = &cd->owner_;
- memcpy(cd->npc_event,ev,sizeof(cd->npc_event));
+ memcpy(cd->npc_event,ev,strlen(ev));
cd->bl.id = map_addobject(&cd->bl);
if(cd->bl.id==0){
- free(cd);
+ aFree(cd);
return 0;
}
nd->chat_id=cd->bl.id;