summaryrefslogtreecommitdiff
path: root/src/common/grfio.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-16 16:19:32 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-04-16 16:19:32 +0000
commit3531bd5992af838ba43f886a4c9c01745bb6062a (patch)
tree26887862d4541850158d42c08a2f3890b32ad9c0 /src/common/grfio.c
parent6170c4fe2a6dc695a87b79c7d5d0aa4b395af7fa (diff)
downloadhercules-3531bd5992af838ba43f886a4c9c01745bb6062a.tar.gz
hercules-3531bd5992af838ba43f886a4c9c01745bb6062a.tar.bz2
hercules-3531bd5992af838ba43f886a4c9c01745bb6062a.tar.xz
hercules-3531bd5992af838ba43f886a4c9c01745bb6062a.zip
- Removed water_height.txt reading (since it is always done from the rsw now)
- Fixed a possible crash in grfio_find_file - Corrected water-level-reading to account for a return of null from the previously mentioned function git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6117 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/grfio.c')
-rw-r--r--src/common/grfio.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 612932e24..81a5ef7c5 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -20,6 +20,7 @@
* 2003/10/21 ... The data of alpha client was read.
* 2003/11/10 ... Ready new grf format.
* 2003/11/11 ... version check fix & bug fix
+ * 2006/04/16 ... fixed crash grfio_find_file when file is not found.
*/
#include <stdio.h>
@@ -456,7 +457,9 @@ static FILELIST *filelist_find(char *fname)
}
char *grfio_find_file(char *fname){
- return ((filelist_find(fname)->fnd == NULL)? filelist_find(fname)->fn: filelist_find(fname)->fnd);
+ FILELIST *filelist = filelist_find(fname);
+ if (!filelist) return NULL;
+ return (!filelist->fnd?filelist->fn:filelist->fnd);
}
/*==========================================