compute (100*a)/b. Instead compute 100*(a/b), because that way
there's no chance that 100*a will become inexact enough to fail to
yield 100 when a==b.)
git-svn-id: svn://svn.tartarus.org/sgt/putty@1254
cda61777-01e9-0310-a592-
d414129be87e
sprintf(etastr, "%02ld:%02ld:%02ld",
eta / 3600, (eta % 3600) / 60, eta % 60);
- pct = (int) (100.0 * (float) done / size);
+ pct = (int) (100 * (done * 1.0 / size));
len = printf("\r%-25.25s | %10ld kB | %5.1f kB/s | ETA: %8s | %3d%%",
name, done / 1024, ratebs / 1024.0, etastr, pct);