Issue information

Issue ID
#1063
Status
Fixed
Severity
None
Started
Hercules Elf Bot
Feb 28, 2008 0:57
Last Post
Hercules Elf Bot
Feb 28, 2008 0:57
Confirmation
N/A

Hercules Elf Bot - Feb 28, 2008 0:57

Originally posted by [b]theultramage[/b]
http://www.eathena.ws/board/index.php?autocom=bugtracker&showbug=1063

I copy-pasted some short script off the forums, tabs replaced by spaces and such. When parsing this script, the mapserver said
CODE
[Error]: npc_parsesrcfile: Unknown syntax in file 'npc/xxx.txt', line '1'. Stopping...
* w1=prontera,164,186,5    script    cleararray    100,{
* w2=
* w3=
* w4=☺prontera,164,186,5    script    cleararray    100,{

The reason why w4 is like that is
CODE
        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] = '\';
in this case, pos[1] is 51 and pos[8] is -1, so the zero byte ends up way further than it should.