summaryrefslogtreecommitdiff
path: root/src/map/npc.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/npc.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/npc.c')
-rw-r--r--src/map/npc.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 5d8a0274e..8de53a64e 100644
--- a/src/map/npc.c
+++ b/src/map/npc.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/timer.h"
@@ -1915,7 +1916,7 @@ void npc_addsrcfile(const char* name)
file = (struct npc_src_list*)aMalloc(sizeof(struct npc_src_list) + strlen(name));
file->next = NULL;
- strncpy(file->name, name, strlen(name) + 1);
+ safestrncpy(file->name, name, strlen(name) + 1);
if( file_prev == NULL )
npc_src_files = file;
else
@@ -3606,7 +3607,7 @@ void npc_read_event_script(void)
DBData *data;
char name[64]="::";
- strncpy(name+2,config[i].event_name,62);
+ safestrncpy(name+2,config[i].event_name,62);
script_event[i].event_count = 0;
iter = db_iterator(ev_db);