From 3531bd5992af838ba43f886a4c9c01745bb6062a Mon Sep 17 00:00:00 2001 From: skotlex Date: Sun, 16 Apr 2006 16:19:32 +0000 Subject: - 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 --- src/common/grfio.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/common') 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 @@ -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); } /*========================================== -- cgit v1.2.3-70-g09d2