summaryrefslogtreecommitdiff
path: root/src/map/npc.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-02-19 16:57:01 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2009-02-19 16:57:01 +0000
commit2d6cf0c06e355b0e697b5372a03e189d75893502 (patch)
tree62517b0b543d4ee194ec1dd3ded572f34b21d468 /src/map/npc.c
parentb1a7decb5f4f88f49ab42f87cd4e770542affd69 (diff)
downloadhercules-2d6cf0c06e355b0e697b5372a03e189d75893502.tar.gz
hercules-2d6cf0c06e355b0e697b5372a03e189d75893502.tar.bz2
hercules-2d6cf0c06e355b0e697b5372a03e189d75893502.tar.xz
hercules-2d6cf0c06e355b0e697b5372a03e189d75893502.zip
* Fixed impropper filling of w4 in npc_parsesrcfile when there are less than 4 fields. (bugreport:1063)
* Simplified atcommand_spiritball. (deprecated msg_txt 204 and 205) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@13538 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/npc.c')
-rw-r--r--src/map/npc.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index a95b490d9..1014cc832 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -2875,9 +2875,14 @@ void npc_parsesrcfile(const char* filepath)
// fill w4 (to end of line)
if( pos[1]-pos[8] > ARRAYLENGTH(w4)-1 )
ShowWarning("npc_parsesrcfile: w4 truncated, too much data (%d) in file '%s', line '%d'.\n", pos[1]-pos[8], filepath, strline(buffer,p-buffer));
- i = min(pos[1]-pos[8], ARRAYLENGTH(w4)-1);
- memcpy(w4, p+pos[8], i*sizeof(char));
- w4[i] = '\0';
+ if( pos[8] != -1 )
+ {
+ i = min(pos[1]-pos[8], ARRAYLENGTH(w4)-1);
+ memcpy(w4, p+pos[8], i*sizeof(char));
+ w4[i] = '\0';
+ }
+ else
+ w4[0] = '\0';
if( count < 3 )
{// Unknown syntax