fixed FS free space check false positives (integer overrun)
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6401 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -363,7 +363,7 @@ bool stream::getline(char *str, int len)
|
||||
|
||||
#ifdef __linux__
|
||||
#include <sys/statvfs.h>
|
||||
#define MINFSSIZE 50000000 // 50MB
|
||||
#define MINFSSIZE 50000000ull // 50MB
|
||||
#endif
|
||||
|
||||
struct filestream : stream
|
||||
@@ -382,7 +382,7 @@ struct filestream : stream
|
||||
if(file && strchr(mode,'w'))
|
||||
{
|
||||
int fail = fstatvfs(fileno(file), &buf);
|
||||
if (fail || buf.f_frsize * buf.f_bavail < MINFSSIZE)
|
||||
if (fail || (unsigned long long)buf.f_frsize * (unsigned long long)buf.f_bavail < MINFSSIZE)
|
||||
{
|
||||
close();
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user