summaryrefslogtreecommitdiff
path: root/src/char
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/char
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/char')
-rw-r--r--src/char/int_guild.c7
-rw-r--r--src/char/int_pet.c7
2 files changed, 8 insertions, 6 deletions
diff --git a/src/char/int_guild.c b/src/char/int_guild.c
index 7090af5ee..9cb17dca8 100644
--- a/src/char/int_guild.c
+++ b/src/char/int_guild.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/mmo.h"
@@ -1815,7 +1816,7 @@ int mapif_parse_GuildMasterChange(int fd, int guild_id, const char* name, int le
g->member[0].position = 0; //Position 0: guild Master.
g->member[0].modified = GS_MEMBER_MODIFIED;
- strncpy(g->master, name, len);
+ safestrncpy(g->master, name, len);
if (len < NAME_LENGTH)
g->master[len] = '\0';
diff --git a/src/char/int_pet.c b/src/char/int_pet.c
index 114398290..d9b0cf5ef 100644
--- a/src/char/int_pet.c
+++ b/src/char/int_pet.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/mmo.h"
#include "../common/malloc.h"
@@ -184,7 +185,7 @@ int mapif_create_pet(int fd, int account_id, int char_id, short pet_class, short
short pet_equip, short intimate, short hungry, char rename_flag, char incuvate, char *pet_name)
{
memset(pet_pt, 0, sizeof(struct s_pet));
- strncpy(pet_pt->name, pet_name, NAME_LENGTH);
+ safestrncpy(pet_pt->name, pet_name, NAME_LENGTH);
if(incuvate == 1)
pet_pt->account_id = pet_pt->char_id = 0;
else {