summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-23 11:56:44 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2010-11-23 11:56:44 +0000
commit326bb46c02abb20c39239b2067f3bf4df884cbe3 (patch)
treeaf0d93f151158654c5e0d1838d0336723db27c69 /src
parent959fcb568df0534989eba2f23870a12aaecb91a2 (diff)
downloadhercules-326bb46c02abb20c39239b2067f3bf4df884cbe3.tar.gz
hercules-326bb46c02abb20c39239b2067f3bf4df884cbe3.tar.bz2
hercules-326bb46c02abb20c39239b2067f3bf4df884cbe3.tar.xz
hercules-326bb46c02abb20c39239b2067f3bf4df884cbe3.zip
* Labels longer than 23 characters will no longer cause the server to exit immediately (bugreport:4563, since r1213).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14494 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/npc.c19
1 files changed, 10 insertions, 9 deletions
diff --git a/src/map/npc.c b/src/map/npc.c
index 95981ad55..dcfa52193 100644
--- a/src/map/npc.c
+++ b/src/map/npc.c
@@ -1940,14 +1940,6 @@ int npc_convertlabel_db(DBKey key, void* data, va_list ap)
nullpo_ret(label_list_num = va_arg(ap,int*));
nullpo_ret(filepath = va_arg(ap,const char*));
- if( *label_list == NULL )
- {
- *label_list = (struct npc_label_list *) aCallocA (1, sizeof(struct npc_label_list));
- *label_list_num = 0;
- } else
- *label_list = (struct npc_label_list *) aRealloc (*label_list, sizeof(struct npc_label_list)*(*label_list_num+1));
- label = *label_list+*label_list_num;
-
// In case of labels not terminated with ':', for user defined function support
p = lname;
while( ISALNUM(*p) || *p == '_' )
@@ -1958,8 +1950,17 @@ int npc_convertlabel_db(DBKey key, void* data, va_list ap)
if( len > 23 )
{
ShowError("npc_parse_script: label name longer than 23 chars! '%s'\n (%s)", lname, filepath);
- exit(EXIT_FAILURE);
+ return 0;
}
+
+ if( *label_list == NULL )
+ {
+ *label_list = (struct npc_label_list *) aCallocA (1, sizeof(struct npc_label_list));
+ *label_list_num = 0;
+ } else
+ *label_list = (struct npc_label_list *) aRealloc (*label_list, sizeof(struct npc_label_list)*(*label_list_num+1));
+ label = *label_list+*label_list_num;
+
safestrncpy(label->name, lname, sizeof(label->name));
label->pos = lpos;
++(*label_list_num);