Skip to content

Commit e190bbf

Browse files
committed
Correct % processed for Windows large files
1 parent bd17f75 commit e190bbf

File tree

7 files changed

+8
-2
lines changed

7 files changed

+8
-2
lines changed

CHANGES.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,3 +98,6 @@ Aug 2019 (v5.1.3)
9898

9999
Aug 2019 (v5.1.4)
100100
* Newer compilers have changed bitfield structure padding layouts
101+
102+
Sep 2019 (v5.1.5)
103+
* Percentage processed was not showing correctly for very large files on Windows

bin/aix/convH

0 Bytes
Binary file not shown.

bin/aix/mqsmfcsv

-108 Bytes
Binary file not shown.

bin/linux/convH

0 Bytes
Binary file not shown.

bin/linux/mqsmfcsv

400 Bytes
Binary file not shown.

bin/win/mqsmfcsv.exe

-321 KB
Binary file not shown.

src/mqsmf.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1396,10 +1396,13 @@ static char *getFormatRate(myoff_t pos)
13961396
static char formatPercentString[10];
13971397
static char *getFormatPercent(myoff_t totalFileSize,myoff_t pos)
13981398
{
1399+
float f;
13991400
if (streamInput) {
14001401
strcpy(formatPercentString,"");
1401-
} else {
1402-
sprintf(formatPercentString,"[%5.2f%%]", (float)(100.0*pos)/totalFileSize);
1402+
} else {
1403+
f = (float)((100.0*pos)/totalFileSize);
1404+
if (f==0) f = +0.00; /* To deal with calculation sometimes returning -0.0 */
1405+
sprintf(formatPercentString,"[%5.2f%%]", f);
14031406
}
14041407
return formatPercentString;
14051408
}

0 commit comments

Comments
 (0)