From 2323874b577eb9451832c82528b70bc8d89c725c Mon Sep 17 00:00:00 2001 From: sireus Date: Mon, 2 May 2011 13:39:46 +0000 Subject: [PATCH] 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 --- source/src/stream.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/src/stream.cpp b/source/src/stream.cpp index 9c7f15e0..a43d4367 100644 --- a/source/src/stream.cpp +++ b/source/src/stream.cpp @@ -363,7 +363,7 @@ bool stream::getline(char *str, int len) #ifdef __linux__ #include -#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;