mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 17:03:03 +01:00
Fix bug causing file transfer status bars to be truncated
This commit is contained in:
parent
8d9d51640c
commit
0434ac186a
@ -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;
|
||||
|
||||
|
@ -683,6 +683,9 @@ void line_info_set(ToxWindow *self, uint32_t id, char *msg)
|
||||
|
||||
while (line) {
|
||||
if (line->id == id) {
|
||||
size_t new_len = strlen(msg);
|
||||
line->len = line->len - line->msg_len + new_len;
|
||||
line->msg_len = new_len;
|
||||
snprintf(line->msg, sizeof(line->msg), "%s", msg);
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user