summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2016-03-06 19:03:35 +0100
committerHaru <haru@dotalux.com>2016-03-06 19:03:35 +0100
commit4a2c0e09bf758b57a52d9714d5306fee587544cd (patch)
tree2fb742d8ff32457e1a11ad8286b9f97a21749fc3
parenta9a12ef0b35b6e9aa220d5a55f95096277326730 (diff)
parent15bb994898c212d3e02f404aa970a950d21a6554 (diff)
downloadhercules-4a2c0e09bf758b57a52d9714d5306fee587544cd.tar.gz
hercules-4a2c0e09bf758b57a52d9714d5306fee587544cd.tar.bz2
hercules-4a2c0e09bf758b57a52d9714d5306fee587544cd.tar.xz
hercules-4a2c0e09bf758b57a52d9714d5306fee587544cd.zip
Merge pull request #1188 from 4144/partycreate
Replace wrong wariable usage in party creation code (closed #1185)
-rw-r--r--src/char/int_party.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index c011f1b8f..684d846d4 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -485,7 +485,7 @@ int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const
int i;
nullpo_ret(name);
nullpo_ret(leader);
- if( (p=inter_party->search_partyname(name))!=NULL){
+ if (!*name || (p = inter_party->search_partyname(name)) != NULL) {
mapif->party_created(fd,leader->account_id,leader->char_id,NULL);
return 0;
}
@@ -496,7 +496,8 @@ int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const
if (name[i] == '"') { /* client-special-char */
char *newname = aStrndup(name, NAME_LENGTH-1);
normalize_name(newname,"\"");
- mapif->parse_CreateParty(fd,name,item,item2,leader);
+ trim(newname);
+ mapif->parse_CreateParty(fd, newname, item, item2, leader);
aFree(newname);
return 0;
}
@@ -513,7 +514,7 @@ int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const
p = (struct party_data*)aCalloc(1, sizeof(struct party_data));
- memcpy(p->party.name,name,NAME_LENGTH);
+ safestrncpy(p->party.name, name, NAME_LENGTH);
p->party.exp=0;
p->party.item=(item?1:0)|(item2?2:0);