diff options
Diffstat (limited to 'src/map/guild.c')
-rw-r--r-- | src/map/guild.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/map/guild.c b/src/map/guild.c index 0eae68b57..aa91ee3ac 100644 --- a/src/map/guild.c +++ b/src/map/guild.c @@ -400,13 +400,14 @@ int guild_send_dot_remove(struct map_session_data *sd) // 作成要求 int guild_create(struct map_session_data *sd,char *name) { - char *tname = aStrdup(name); + char tname[NAME_LENGTH]; nullpo_retr(0, sd); - if(sd->status.guild_id || strlen(trim(tname)) < 2) + safestrncpy(tname, name, NAME_LENGTH); + + if(sd->status.guild_id || strlen(trim(tname)) == 0) { clif_guild_created(sd,1); // すでに所属している - aFree(tname); return 0; } if(!battle_config.guild_emperium_check || pc_search_inventory(sd,714) >= 0) { @@ -414,11 +415,9 @@ int guild_create(struct map_session_data *sd,char *name) guild_makemember(&m,sd); m.position=0; intif_guild_create(name,&m); - aFree(tname); return 1; } clif_guild_created(sd,3); // エンペリウムがいない - aFree(tname); return 0; } |