Skip to content
Snippets Groups Projects
Commit 73b2752e authored by Vytor Calixto's avatar Vytor Calixto :space_invader:
Browse files

Fixed overflow on hasEnoughSpace

parent d486321b
Branches
Tags v0.1.0
1 merge request!1Lento
...@@ -52,7 +52,8 @@ bool hasEnoughSpace(int size){ ...@@ -52,7 +52,8 @@ bool hasEnoughSpace(int size){
struct statvfs fsData; struct statvfs fsData;
string path = getWorkingPath(); string path = getWorkingPath();
statvfs(path.c_str(), &fsData); statvfs(path.c_str(), &fsData);
int freeSpace = fsData.f_bsize * fsData.f_bfree; long long freeSpace = fsData.f_bsize * fsData.f_bfree;
cout << "freeSpace: " << freeSpace << "fsData: " << fsData.f_bsize << "\t" << fsData.f_bfree << endl;
return (freeSpace > size); return (freeSpace > size);
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment