mirror of https://github.com/aria2/aria2
Fixed overflow in the calculation of progress percentage for file
allocation and hash check when off_t is 32bit.pull/1/head
parent
be1e168082
commit
27974108f0
|
@ -311,7 +311,7 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e)
|
|||
<< "B"
|
||||
<< "(";
|
||||
if(entry->getTotalLength() > 0) {
|
||||
o << 100*entry->getCurrentLength()/entry->getTotalLength();
|
||||
o << 100LL*entry->getCurrentLength()/entry->getTotalLength();
|
||||
} else {
|
||||
o << "--";
|
||||
}
|
||||
|
@ -337,9 +337,13 @@ ConsoleStatCalc::calculateStat(const DownloadEngine* e)
|
|||
<< "/"
|
||||
<< sizeFormatter(entry->getTotalLength())
|
||||
<< "B"
|
||||
<< "("
|
||||
<< 100*entry->getCurrentLength()/entry->getTotalLength()
|
||||
<< "%)"
|
||||
<< "(";
|
||||
if(entry->getTotalLength() > 0) {
|
||||
o << 100LL*entry->getCurrentLength()/entry->getTotalLength();
|
||||
} else {
|
||||
o << "--";
|
||||
}
|
||||
o << "%)"
|
||||
<< "]";
|
||||
if(e->getCheckIntegrityMan()->hasNext()) {
|
||||
o << "("
|
||||
|
|
Loading…
Reference in New Issue