Skip to content
Snippets Groups Projects
Commit f6ebc857 authored by rswindell's avatar rswindell
Browse files

getfreediskspace() - treat unit value of 1 the same as 0 (no need to divide

or shift).
parent 310b41a6
Branches
Tags
No related merge requests found
......@@ -619,7 +619,7 @@ ulong DLLCALL getfreediskspace(const char* path, ulong unit)
NULL)) // receives the free bytes on disk
return(0);
if(unit)
if(unit>1)
avail.QuadPart=Int64ShrlMod32(avail.QuadPart,bit_num(unit));
#if defined(_ANONYMOUS_STRUCT)
......@@ -647,7 +647,7 @@ ulong DLLCALL getfreediskspace(const char* path, ulong unit)
))
return(0);
if(unit)
if(unit>1)
NumberOfFreeClusters/=unit;
return(NumberOfFreeClusters*SectorsPerCluster*BytesPerSector);
......@@ -660,7 +660,7 @@ ulong DLLCALL getfreediskspace(const char* path, ulong unit)
if (statfs(path, &fs) < 0)
return 0;
if(unit)
if(unit>1)
fs.f_bavail/=unit;
return fs.f_bsize * fs.f_bavail;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment