1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-01 10:46:45 +02:00

Fix bug causing file transfer status bars to be truncated

This commit is contained in:
jfreegman
2020-11-26 15:35:04 -05:00
parent 8d9d51640c
commit 0434ac186a
2 changed files with 8 additions and 3 deletions

View File

@ -60,13 +60,15 @@ void print_progress_bar(ToxWindow *self, double bps, double pct_done, uint32_t l
return;
}
char pct_str[STR_BUF_SIZE] = {0};
char pct_str[STR_BUF_SIZE];
snprintf(pct_str, sizeof(pct_str), "%.1f%%", pct_done);
char bps_str[STR_BUF_SIZE] = {0};
char bps_str[STR_BUF_SIZE];
bytes_convert_str(bps_str, sizeof(bps_str), bps);
char prog_line[NUM_PROG_MARKS + 1] = {0};
char prog_line[NUM_PROG_MARKS + 1];
prog_line[0] = 0;
int n = pct_done / (100 / NUM_PROG_MARKS);
int i, j;