* Corrected a fex misshaps from r11571:

- disabling the memory manager
- using the wrong length for the title and body in mail_savemessage
* Removed the quick-fix in the npc duplicate check and the impossible condition that is generating the warning.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@11573 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
FlavioJS 2007-10-24 13:29:00 +00:00
parent 480a4f0ac8
commit d9774ac8ca
4 changed files with 10 additions and 9 deletions

View File

@ -4,6 +4,11 @@ AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
2007/10/24 2007/10/24
* Corrected a fex misshaps from r11571:
- disabling the memory manager
- using the wrong length for the title and body in mail_savemessage
* Removed the quick-fix in the npc duplicate check and the impossible condition
that is generating the warning. [FlavioJS]
* @/#jobchange no longer strips your equipment since pc_jobchange removes * @/#jobchange no longer strips your equipment since pc_jobchange removes
any unequippables already. any unequippables already.
* Removed the wasteful define MAX_PC_CLASS and replaced it by the * Removed the wasteful define MAX_PC_CLASS and replaced it by the

View File

@ -124,8 +124,8 @@ static int mail_savemessage(struct mail_message* msg)
if( SQL_SUCCESS != SqlStmt_PrepareStr(stmt, StringBuf_Value(&buf)) if( SQL_SUCCESS != SqlStmt_PrepareStr(stmt, StringBuf_Value(&buf))
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, msg->send_name, strnlen(msg->send_name, NAME_LENGTH)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 0, SQLDT_STRING, msg->send_name, strnlen(msg->send_name, NAME_LENGTH))
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, msg->dest_name, strnlen(msg->dest_name, NAME_LENGTH)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 1, SQLDT_STRING, msg->dest_name, strnlen(msg->dest_name, NAME_LENGTH))
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 2, SQLDT_STRING, msg->title, strnlen(msg->title, NAME_LENGTH)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 2, SQLDT_STRING, msg->title, strnlen(msg->title, MAIL_TITLE_LENGTH))
|| SQL_SUCCESS != SqlStmt_BindParam(stmt, 3, SQLDT_STRING, msg->body, strnlen(msg->body, NAME_LENGTH)) || SQL_SUCCESS != SqlStmt_BindParam(stmt, 3, SQLDT_STRING, msg->body, strnlen(msg->body, MAIL_BODY_LENGTH))
|| SQL_SUCCESS != SqlStmt_Execute(stmt) ) || SQL_SUCCESS != SqlStmt_Execute(stmt) )
{ {
Sql_ShowDebug(sql_handle); Sql_ShowDebug(sql_handle);

View File

@ -28,7 +28,7 @@
// Whether to use Athena's built-in Memory Manager (enabled by default) // Whether to use Athena's built-in Memory Manager (enabled by default)
// To disable just comment the following line // To disable just comment the following line
#if !defined(DMALLOC) && !defined(BCHECK) #if !defined(DMALLOC) && !defined(BCHECK)
//#define USE_MEMMGR #define USE_MEMMGR
#endif #endif
// Whether to enable Memory Manager's logging // Whether to enable Memory Manager's logging
#define LOG_MEMMGR #define LOG_MEMMGR

View File

@ -1419,7 +1419,7 @@ void npc_delsrcfile(const char* name)
static void npc_parsename(struct npc_data* nd, const char* name, const char* start, const char* buffer, const char* filepath) static void npc_parsename(struct npc_data* nd, const char* name, const char* start, const char* buffer, const char* filepath)
{ {
const char* p; const char* p;
struct npc_data* dnd; struct npc_data* dnd;// duplicate npc
char newname[NAME_LENGTH]; char newname[NAME_LENGTH];
// parse name // parse name
@ -1458,16 +1458,12 @@ static void npc_parsename(struct npc_data* nd, const char* name, const char* sta
safestrncpy(nd->exname, newname, sizeof(nd->exname)); safestrncpy(nd->exname, newname, sizeof(nd->exname));
} }
if( *nd->exname == '\0' || (dnd=npc_name2id(nd->exname)) != NULL ) if( (dnd=npc_name2id(nd->exname)) != NULL )
{// duplicate unique name, generate new one {// duplicate unique name, generate new one
char this_mapname[32]; char this_mapname[32];
char other_mapname[32]; char other_mapname[32];
int i = 0; int i = 0;
//TODO: the debug message is broken, if nd->exname == NULL
//dnd is left uninitialized, and then is printed as that!
if (*nd->exname == '\0')
dnd = nd; //Dumb anti-crash measure since I am not sure what this piece of code is supposed to do.
do do
{ {
++i; ++i;