summaryrefslogtreecommitdiff
path: root/src/map/itemdb.c
diff options
context:
space:
mode:
authorultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-12 23:15:27 +0000
committerultramage <ultramage@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-10-12 23:15:27 +0000
commit7fed7ca773550e124e256a6c976ea2762cf9498b (patch)
tree48d5d5ebd6d50b46fb58c5231acf95544c35c2cc /src/map/itemdb.c
parent96dd8cdf7ac9778cbb84b7c67f65296b8f723eb5 (diff)
downloadhercules-7fed7ca773550e124e256a6c976ea2762cf9498b.tar.gz
hercules-7fed7ca773550e124e256a6c976ea2762cf9498b.tar.bz2
hercules-7fed7ca773550e124e256a6c976ea2762cf9498b.tar.xz
hercules-7fed7ca773550e124e256a6c976ea2762cf9498b.zip
* Fixed wrong index calculation in TXT char creation code (ref: r11410)
* Fixed SQL itemdb loading crash on NULL columns (ref: 11398) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@11434 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/itemdb.c')
-rw-r--r--src/map/itemdb.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/map/itemdb.c b/src/map/itemdb.c
index 70a056292..99e74cbbe 100644
--- a/src/map/itemdb.c
+++ b/src/map/itemdb.c
@@ -929,10 +929,14 @@ static int itemdb_read_sqldb(void)
while( SQL_SUCCESS == Sql_NextRow(mmysql_handle) )
{// wrap the result into a TXT-compatible format
char* str[22];
+ char* dummy = "";
int i;
++lines;
for( i = 0; i < 22; ++i )
+ {
Sql_GetData(mmysql_handle, i, &str[i], NULL);
+ if( str[i] == NULL ) str[i] = dummy; // get rid of NULL columns
+ }
if (!itemdb_parse_dbrow(str, item_db_name[fi], lines, 0))
continue;