From 638e2b5c985c13a8138d1cb166d5fdb8148b690c Mon Sep 17 00:00:00 2001 From: shennetsind Date: Thu, 31 Jan 2013 16:11:07 -0200 Subject: 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 --- src/map/elemental.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/map/elemental.c') diff --git a/src/map/elemental.c b/src/map/elemental.c index 90b90c1e3..f6c9eff84 100644 --- a/src/map/elemental.c +++ b/src/map/elemental.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" @@ -10,6 +11,7 @@ #include "../common/showmsg.h" #include "../common/utils.h" #include "../common/random.h" +#include "../common/strlib.h" #include "log.h" #include "clif.h" @@ -795,8 +797,8 @@ int read_elementaldb(void) { db = &elemental_db[j]; db->class_ = atoi(str[0]); - strncpy(db->sprite, str[1], NAME_LENGTH); - strncpy(db->name, str[2], NAME_LENGTH); + safestrncpy(db->sprite, str[1], NAME_LENGTH); + safestrncpy(db->name, str[2], NAME_LENGTH); db->lv = atoi(str[3]); status = &db->status; -- cgit v1.2.3-70-g09d2