summaryrefslogtreecommitdiff
path: root/src/common/grfio.c
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-20 18:13:04 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-12-20 18:13:04 +0000
commit958273319fea7cdc8b82ec988ae6c235c7657ca2 (patch)
tree199f7180bd715e3773cf5a19df5f37dc2c977daf /src/common/grfio.c
parent114a63af2cecc309da7e34ddf65e5eb3156126af (diff)
downloadhercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.tar.gz
hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.tar.bz2
hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.tar.xz
hercules-958273319fea7cdc8b82ec988ae6c235c7657ca2.zip
* Added auto reading leveluseskillspamount.txt and indoorrswtable.txt
* Added check in grfio.c to prevent crashing git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@667 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/common/grfio.c')
-rw-r--r--src/common/grfio.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/src/common/grfio.c b/src/common/grfio.c
index 507b66cb3..b005398cc 100644
--- a/src/common/grfio.c
+++ b/src/common/grfio.c
@@ -444,13 +444,13 @@ int grfio_size(char *fname)
entry = filelist_find(fname);
if (entry==NULL || entry->gentry<0) { // LocalFileCheck
- char lfname[256],rname[256],*p;
+ char lfname[256],*rname,*p;
FILELIST lentry;
struct stat st;
- if(strcmp(data_dir, "") != 0) {
+ if(strcmp(data_dir, "") != 0 && (rname=grfio_resnametable(fname,lfname))!=NULL) {
//printf("%s\t",fname);
- sprintf(rname,"%s",grfio_resnametable(fname,lfname));
+ //sprintf(rname,"%s",grfio_resnametable(fname,lfname));
//printf("%s\n",rname);
sprintf(lfname,"%s%s",data_dir,rname);
//printf("%s\n",lfname);
@@ -486,13 +486,16 @@ void* grfio_reads(char *fname, int *size)
entry = filelist_find(fname);
if (entry==NULL || entry->gentry<=0) { // LocalFileCheck
- char lfname[256],rname[256],*p;
+ char lfname[256],*rname,*p;
FILELIST lentry;
strncpy(lfname,fname,255);
- sprintf(rname,"%s",grfio_resnametable(fname,lfname));
- sprintf(lfname,"%s%s",data_dir,rname);
- //printf("%s\n",lfname);
+ // i hope this is the correct way =p [celest]
+ if ((rname=grfio_resnametable(fname,lfname))!=NULL) {
+ //sprintf(rname,"%s",grfio_resnametable(fname,lfname));
+ sprintf(lfname,"%s%s",data_dir,rname);
+ //printf("%s\n",lfname);
+ }
for(p=&lfname[0];*p!=0;p++) if (*p=='\\') *p = '/'; // * At the time of Unix