summaryrefslogtreecommitdiff
path: root/src/map/homunculus.c
diff options
context:
space:
mode:
authorshennetsind <ind@henn.et>2013-01-31 16:11:07 -0200
committershennetsind <ind@henn.et>2013-01-31 16:11:07 -0200
commit638e2b5c985c13a8138d1cb166d5fdb8148b690c (patch)
tree61b8cc443ac8171cd203a89744c31d5d51664b2a /src/map/homunculus.c
parentfc2e159d8c3d45ddeae4ce1dcc84312303442745 (diff)
downloadhercules-638e2b5c985c13a8138d1cb166d5fdb8148b690c.tar.gz
hercules-638e2b5c985c13a8138d1cb166d5fdb8148b690c.tar.bz2
hercules-638e2b5c985c13a8138d1cb166d5fdb8148b690c.tar.xz
hercules-638e2b5c985c13a8138d1cb166d5fdb8148b690c.zip
Fixed Bug #3080
Replaced strncpy with safestrncpy where I found would be beneficial. http://hercules.ws/board/tracker/issue-3080-safestrncpy-instead-of-strncpy-where-applicable/ Also modifying headers accordingly. Signed-off-by: shennetsind <ind@henn.et>
Diffstat (limited to 'src/map/homunculus.c')
-rw-r--r--src/map/homunculus.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/map/homunculus.c b/src/map/homunculus.c
index 081287d8a..c94a95775 100644
--- a/src/map/homunculus.c
+++ b/src/map/homunculus.c
@@ -1,5 +1,6 @@
-// Copyright (c) Athena Dev Teams - Licensed under GNU GPL
-// For more information, see LICENCE in the main folder
+// Copyright (c) Hercules dev team, licensed under GNU GPL.
+// See the LICENSE file
+// Portions Copyright (c) Athena dev team
#include "../common/cbasetypes.h"
#include "../common/malloc.h"
@@ -709,7 +710,7 @@ int merc_hom_change_name_ack(struct map_session_data *sd, char* name, int flag)
clif_displaymessage(sd->fd, msg_txt(280)); // You cannot use this name
return 0;
}
- strncpy(hd->homunculus.name,name,NAME_LENGTH);
+ safestrncpy(hd->homunculus.name,name,NAME_LENGTH);
clif_charnameack (0,&hd->bl);
hd->homunculus.rename_flag = 1;
clif_hominfo(sd,hd,0);
@@ -887,7 +888,7 @@ int merc_create_homunculus_request(struct map_session_data *sd, int class_)
memset(&homun, 0, sizeof(struct s_homunculus));
//Initial data
- strncpy(homun.name, homunculus_db[i].name, NAME_LENGTH-1);
+ safestrncpy(homun.name, homunculus_db[i].name, NAME_LENGTH-1);
homun.class_ = class_;
homun.level = 1;
homun.hunger = 32; //32%
@@ -1050,7 +1051,7 @@ static bool read_homunculusdb_sub(char* str[], int columns, int current)
}
db->evo_class = classid;
//Name, Food, Hungry Delay, Base Size, Evo Size, Race, Element, ASPD
- strncpy(db->name,str[2],NAME_LENGTH-1);
+ safestrncpy(db->name,str[2],NAME_LENGTH-1);
db->foodID = atoi(str[3]);
db->hungryDelay = atoi(str[4]);
db->base_size = atoi(str[5]);