summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-12 14:37:02 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-07-12 14:37:02 +0000
commit5ca687b95afe382f415ecb08e3f0c9787dc6347c (patch)
treef592d42aa4253e2899de97d2b1b951da60d0fb45 /src
parent7649499061d19ab7dafa05f39982279103dae1bb (diff)
downloadhercules-5ca687b95afe382f415ecb08e3f0c9787dc6347c.tar.gz
hercules-5ca687b95afe382f415ecb08e3f0c9787dc6347c.tar.bz2
hercules-5ca687b95afe382f415ecb08e3f0c9787dc6347c.tar.xz
hercules-5ca687b95afe382f415ecb08e3f0c9787dc6347c.zip
Improved item_combo_db parsing to detect missing brackets
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16409 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src')
-rw-r--r--src/map/itemdb.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 2acb18714..f6c43b26a 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -786,8 +786,8 @@ void itemdb_read_combos(DBMap* item_combo_db) {
memset(str, 0, sizeof(str));
p = line;
- while (ISSPACE(*p))
- ++p;
+
+ p = trim(p);
if (*p == '\0')
continue;// empty line
@@ -814,7 +814,7 @@ void itemdb_read_combos(DBMap* item_combo_db) {
}
/* no ending key anywhere (missing \}\) */
- if ((p = strstr(p + 1, "}")) == NULL ) {
+ if ( str[1][strlen(str[1])-1] != '}' ) {
ShowError("itemdb_read_combos(#2): Invalid format (Script column) in line %d of \"%s\", skipping.\n", lines, path);
continue;
} else {
@@ -846,7 +846,7 @@ void itemdb_read_combos(DBMap* item_combo_db) {
len += sprintf(combo_out + len - 1, "))%s", str[1]);
- safestrncpy(ic->script + (slen?slen-1:0), combo_out, len);
+ safestrncpy(ic->script + slen, combo_out, len);
if (!exists)
idb_put(item_combo_db, items[0], ic);