summaryrefslogtreecommitdiff
path: root/src/map/mob.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/map/mob.c')
-rw-r--r--src/map/mob.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/map/mob.c b/src/map/mob.c
index 76a89f2e1..79ae84435 100644
--- a/src/map/mob.c
+++ b/src/map/mob.c
@@ -204,7 +204,7 @@ struct mob_data* mob_spawn_dataset(struct spawn_data *data)
md->bl.y = data->y;
md->class_ = data->class_;
md->db = mob_db(md->class_);
- memcpy(md->name, data->name, NAME_LENGTH-1);
+ memcpy(md->name, data->name, NAME_LENGTH);
if (data->state.ai)
md->special_state.ai = data->state.ai;
if (data->state.size)
@@ -2338,9 +2338,9 @@ int mob_class_change (struct mob_data *md, int class_)
md->class_ = class_;
md->db = mob_db(class_);
if (battle_config.override_mob_names==1)
- memcpy(md->name,md->db->name,NAME_LENGTH-1);
+ memcpy(md->name,md->db->name,NAME_LENGTH);
else
- memcpy(md->name,md->db->jname,NAME_LENGTH-1);
+ memcpy(md->name,md->db->jname,NAME_LENGTH);
mob_stop_attack(md);
mob_stop_walking(md, 0);
@@ -3210,9 +3210,9 @@ int mob_parse_dbrow(char** str)
status = &db->status;
db->vd.class_ = class_;
- memcpy(db->sprite, str[1], NAME_LENGTH-1);
- memcpy(db->jname, str[2], NAME_LENGTH-1);
- memcpy(db->name, str[3], NAME_LENGTH-1);
+ strncpy(db->sprite, str[1], NAME_LENGTH);
+ strncpy(db->jname, str[2], NAME_LENGTH);
+ strncpy(db->name, str[3], NAME_LENGTH);
db->lv = atoi(str[4]);
db->lv = cap_value(db->lv, 1, USHRT_MAX);
status->max_hp = atoi(str[5]);