From 1b0feaf380e1714ec3c15d10872b7861e420b5d0 Mon Sep 17 00:00:00 2001 From: Zeex Date: Sat, 2 Jul 2016 11:55:05 +0600 Subject: [PATCH] Remove dubious file size check As the comment right above those lines states, fread() may return a value less than the actual file size beacuse of text conversion done by the system. So why do it? This fixes a bug on Windows where the compiler couldn't read the contents of pawn.cfg because of this check. Interestingly enough, it could read the source files just fine. Fixes #90 --- source/compiler/sc1.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/source/compiler/sc1.c b/source/compiler/sc1.c index 04298c6..765cc31 100644 --- a/source/compiler/sc1.c +++ b/source/compiler/sc1.c @@ -1246,8 +1246,7 @@ static void parserespf(char *filename,char *oname,char *ename,char *pname, * a single '\n', so the string size may be smaller than the file * size. */ memset(string,0,(int)size+1); - if (fread(string,1,(int)size,fp)<(size_t)size) - error(100,filename); /* error reading input file */ + fread(string,1,(int)size,fp); fclose(fp); /* allocate table for option pointers */ if ((argv=(char **)malloc(MAX_OPTIONS*sizeof(char*)))==NULL)