diff options
author | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-04-06 05:19:56 +0000 |
---|---|---|
committer | amber <amber@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2005-04-06 05:19:56 +0000 |
commit | 78a284fab0a3b788cd43caaaa7e057bd4c1084f2 (patch) | |
tree | 858b41c973209f395ce8f324e78f0948d9780fdc | |
parent | 9e10a7900d7e42331d71630624ed0725f2794b92 (diff) | |
download | hercules-78a284fab0a3b788cd43caaaa7e057bd4c1084f2.tar.gz hercules-78a284fab0a3b788cd43caaaa7e057bd4c1084f2.tar.bz2 hercules-78a284fab0a3b788cd43caaaa7e057bd4c1084f2.tar.xz hercules-78a284fab0a3b788cd43caaaa7e057bd4c1084f2.zip |
Fixed and tweaked error messages in npc parsing [MouseJstr]
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1417 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r-- | Changelog-SVN.txt | 2 | ||||
-rw-r--r-- | src/login_sql/login.c | 3 | ||||
-rw-r--r-- | src/map/npc.c | 8 |
3 files changed, 8 insertions, 5 deletions
diff --git a/Changelog-SVN.txt b/Changelog-SVN.txt index 95b2e83f5..6cde9de6e 100644 --- a/Changelog-SVN.txt +++ b/Changelog-SVN.txt @@ -2,6 +2,8 @@ Date Added 04/06 + * Improved error messages during npc parsing [MouseJstr] + * Fixed a crash in login_sql [MouseJstr] * Added logs filters in more logs [Lupus] now you can set individual bit-mask filter for each log file Example: (drops log) diff --git a/src/login_sql/login.c b/src/login_sql/login.c index 7c67b0174..ff9e4706a 100644 --- a/src/login_sql/login.c +++ b/src/login_sql/login.c @@ -166,7 +166,8 @@ int is_user_online(int account_id) { return 0; p = (int*)numdb_search(online_db, account_id); - printf("Acccount %d\n",*p); + if (p != NULL) + printf("Acccount %d\n",*p); return (p != NULL); } diff --git a/src/map/npc.c b/src/map/npc.c index 3369d6b77..d6e219e48 100644 --- a/src/map/npc.c +++ b/src/map/npc.c @@ -1624,7 +1624,7 @@ int npc_convertlabel_db(void *key,void *data,va_list ap) // here we check if the label fit into the buffer if (strlen(lname)>23) { - printf("npc_parse_script: label name longer than 23 chars! '%s'\n", lname); + printf("npc_parse_script: label name longer than 23 chars! '%s'\n (%s)", lname, current_file); exit(1); } memcpy(lst[num].name,lname,strlen(lname)+1); //including EOS @@ -1849,7 +1849,7 @@ why allocing 50 chars ? why checking here? lname is identical to nd->u.scr.label_list[i].name which is only 24 chars so check for strlen should be 23 if (strlen(lname)>24) { - printf("npc_parse_script: label name error !\n"); + printf("npc_parse_script: label name error (%s) !\n", current_file); exit(1); }else{ //struct event_data *ev2; @@ -1871,7 +1871,7 @@ wouldn't it be easier just not to insert the new duplicate event, it is a duplic // and already overwritten if this is here is reached // I leave the check anyway but place it correctly to npc_convertlabel_db if (strlen(lname)>23) { - printf("npc_parse_script: label name longer than 23 chars! '%s'\n", lname); + printf("npc_parse_script: label name longer than 23 chars! '%s' (%s)\n", lname, current_file); exit(1); }else{ struct event_data *ev; @@ -1889,7 +1889,7 @@ wouldn't it be easier just not to insert the new duplicate event, it is a duplic // remember the label is max 50 chars + eos; see the strdb_init below ev2 = (struct event_data *)strdb_search(ev_db,buf); if(ev2 != NULL) { - printf("npc_parse_script : duplicate event %s\n",buf); + printf("npc_parse_script : duplicate event %s (%s)\n",buf, current_file); // just skip the label insertion and free the alloced buffer aFree(buf); |