From 7fed7ca773550e124e256a6c976ea2762cf9498b Mon Sep 17 00:00:00 2001 From: ultramage Date: Fri, 12 Oct 2007 23:15:27 +0000 Subject: * 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 --- src/map/itemdb.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/map/itemdb.c') 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; -- cgit v1.2.3-70-g09d2