Fix progressbar rounding error

An extra char was added when the percentage was 100, caused by
what I believe is a rounding error. An int is good enough here.

By removing the double it fixes the min and max macros beeing used
with a mix between integer and double, and the double beeing used
in printf as a decimal value.
This commit is contained in:
dok 2019-10-16 18:59:30 +02:00 committed by radare
parent cbc5c77813
commit a585dbc2d9

View File

@ -1549,8 +1549,7 @@ static RPrint staticp = {
};
/* TODO: handle screen width */
R_API void r_print_progressbar(RPrint *p, int _pc, int _cols) {
double pc = _pc;
R_API void r_print_progressbar(RPrint *p, int pc, int _cols) {
// TODO: add support for colors
int i, cols = (_cols == -1)? 78: _cols;
if (!p) {