From eb8c83dd3d39ffeb3b7d8455d1f4c4c0b9f7a84c Mon Sep 17 00:00:00 2001 From: L0ne_W0lf Date: Sun, 14 Nov 2010 22:26:26 +0000 Subject: * Updated quest_read_db. Might need reviewing. ;-; - Reports entries when read by server at start up like other DBs. - Will now skip blank lines instead of reporting false errors. - Will report when entries are > MAX_QUEST_DB. * Updated quest and item DB with Eden Group information. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14463 54d463be-8e91-2dee-dedb-b68131a5f0ec --- src/map/quest.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/map/quest.c') diff --git a/src/map/quest.c b/src/map/quest.c index d751b27ff..3e43fcda6 100644 --- a/src/map/quest.c +++ b/src/map/quest.c @@ -314,6 +314,10 @@ int quest_read_db(void) while(fgets(line, sizeof(line), fp)) { + if (k == MAX_QUEST_DB) { + ShowError("quest_read_db: Too many entries specified in %s/quest_db.txt!\n", db_path); + break; + } if(line[0]=='/' && line[1]=='/') continue; memset(str,0,sizeof(str)); @@ -326,6 +330,8 @@ int quest_read_db(void) *np = 0; p = np + 1; } + else if (str[0] == NULL) + continue; else { ShowError("quest_read_db: insufficient columes in line %s\n", line); @@ -352,7 +358,7 @@ int quest_read_db(void) k++; } fclose(fp); - ShowStatus("Done reading '"CL_WHITE"%s"CL_RESET"'.\n","quest_db.txt"); + ShowStatus("Done reading '"CL_WHITE"%d"CL_RESET"' entries in '"CL_WHITE"%s"CL_RESET"'.\n", k, "quest_db.txt"); return 0; } -- cgit v1.2.3-60-g2f50