From 34f200c644ba8598448e20f4aa69a504e55d3c8f Mon Sep 17 00:00:00 2001 From: FlavioJS Date: Fri, 22 Dec 2006 05:27:03 +0000 Subject: - Change strncpy to memcpy when parsing switches in the script engine since it's guaranteed to be a word of that size (skip_word). - Made scriptlabel_db duplicate the key. When str_buf is reallocated, the keys in scriptlabel_db could become invalid, causing a crash in npc_convertlabel_db. ( removed the readded >=0x81 equivalent ) - Now npc_convertlabel_db clears scriptlabel_db after using it. - parse_script has an extra parameter options. At the moment it only indicates if scriptlabel_db should be used or not. - Fixed "UINT_MAX undeclared" on systems that don't declare it in limits.h git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9557 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/itemdb.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/map/itemdb.c') diff --git a/src/map/itemdb.c b/src/map/itemdb.c index b6626fa41..68a61724f 100644 --- a/src/map/itemdb.c +++ b/src/map/itemdb.c @@ -1146,11 +1146,11 @@ static int itemdb_readdb(void) np = strchr(np+1,'}'); //Jump close brackets until the next field is found. if (!np || !np[1]) { //Couldn't find the end of the script field. - id->script = parse_script((unsigned char *) str[19],filename[i],lines); + id->script = parse_script(str[19],filename[i],lines,0); continue; } np[1] = '\0'; //Set end of script - id->script = parse_script((unsigned char *) str[19],filename[i],lines); + id->script = parse_script(str[19],filename[i],lines,0); np+=2; //Skip to next field if(!np || (p=strchr(np,'{'))==NULL) @@ -1163,18 +1163,18 @@ static int itemdb_readdb(void) np = strchr(np+1,'}'); //Jump close brackets until the next field is found. if (!np || !np[1]) { //Couldn't find the end of the script field. - id->equip_script = parse_script((unsigned char *) str[20],filename[i],lines); + id->equip_script = parse_script(str[20],filename[i],lines,0); continue; } np[1] = '\0'; //Set end of script - id->equip_script = parse_script((unsigned char *) str[20],filename[i],lines); + id->equip_script = parse_script(str[20],filename[i],lines,0); np+=2; //Skip comma, to next field if(!np || (p=strchr(np,'{'))==NULL) continue; //Unequip script, last column. - id->unequip_script = parse_script((unsigned char *) p,filename[i],lines); + id->unequip_script = parse_script(p,filename[i],lines,0); } fclose(fp); if (ln > 0) { -- cgit v1.2.3-60-g2f50