Potential Division by Zero
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "../include/reHDD.h"
|
||||
using namespace std;
|
||||
|
||||
|
||||
bool Printer::instanceFlag = false;
|
||||
Printer *Printer::single = NULL;
|
||||
|
||||
@ -224,6 +224,8 @@ double Shred::calcProgress()
|
||||
#ifdef ZERO_CHECK
|
||||
uiMaxShredIteration++; // increment because we will check after SHRED_ITERATIONS the drive for non-zero bytes
|
||||
#endif
|
||||
if (this->ulDriveByteSize == 0)
|
||||
return 0.0;
|
||||
return (double)(((double)ulDriveByteOverallCount) / ((double)this->ulDriveByteSize * uiMaxShredIteration)) * 100.0f;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user