Ver Fonte

* Added SV_READDB_MAX_FIELDS define for configuration of the sv_readdb limit.

git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@14525 54d463be-8e91-2dee-dedb-b68131a5f0ec
ai4rei há 14 anos atrás
pai
commit
739d77f80f
2 ficheiros alterados com 3 adições e 2 exclusões
  1. 1 0
      Changelog-Trunk.txt
  2. 2 2
      src/common/strlib.c

+ 1 - 0
Changelog-Trunk.txt

@@ -1,6 +1,7 @@
 Date	Added
 
 2010/11/30
+	* Added SV_READDB_MAX_FIELDS define for configuration of the sv_readdb limit. [Ai4rei]
 	* Made skill_tree.txt reading use sv_readdb. [Ai4rei]
 	- Added define for skill entry requirements.
 	- Reports duplicate skills within same job class.

+ 2 - 2
src/common/strlib.c

@@ -12,7 +12,7 @@
 #include <errno.h>
 
 
-
+#define SV_READDB_MAX_FIELDS 63
 #define J_MAX_MALLOC_SIZE 65535
 
 // escapes a string in-place (' -> \' , \ -> \\ , % -> _)
@@ -923,7 +923,7 @@ bool sv_readdb(const char* directory, const char* filename, char delim, int minc
 	FILE* fp;
 	int lines = 0;
 	int entries = 0;
-	char* fields[64]; // room for 63 fields ([0] is reserved)
+	char* fields[SV_READDB_MAX_FIELDS+1]; // room for SV_READDB_MAX_FIELDS fields ([0] is reserved)
 	int columns;
 	char path[1024], line[1024];