From ca96d6732c71834c6424dfeb4b6696c381f6c662 Mon Sep 17 00:00:00 2001 From: ultramage Date: Thu, 10 Apr 2008 19:07:00 +0000 Subject: Modified the charservers to use a DBMap instead of a cyclic array for auth data. Merged the auth fix from r12473 to TXT as well. Removed the no-op from r12547. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@12551 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/char/inter.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/char/inter.c') diff --git a/src/char/inter.c b/src/char/inter.c index bb4b86367..6c4b1e3e2 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -8,6 +8,7 @@ #include "../common/malloc.h" #include "../common/lock.h" #include "../common/showmsg.h" +#include "../common/strlib.h" #include "char.h" #include "inter.h" #include "int_party.h" @@ -480,14 +481,13 @@ static struct WisData* mapif_create_whisper(int fd, char* src, char* dst, char* } // Wisp/page request to send -int mapif_parse_WisRequest(int fd) { +int mapif_parse_WisRequest(int fd) +{ struct mmo_charstatus* char_status; struct WisData* wd; char name[NAME_LENGTH]; int fd2; - RFIFOHEAD(fd); - if (RFIFOW(fd,2)-52 >= sizeof(wd->msg)) { ShowWarning("inter: Wis message size too long.\n"); return 0; @@ -496,8 +496,8 @@ int mapif_parse_WisRequest(int fd) { return 0; } - memcpy(name, RFIFOP(fd,28), NAME_LENGTH); //Received name may be too large and not contain \0! [Skotlex] - name[NAME_LENGTH-1]= '\0'; + safestrncpy(name, (char*)RFIFOP(fd,28), NAME_LENGTH); //Received name may be too large and not contain \0! [Skotlex] + // search if character exists before to ask all map-servers char_status = search_character_byname(name); if (char_status == NULL) -- cgit v1.2.3-70-g09d2