mirror of
https://github.com/ElementsProject/lightning.git
synced 2025-03-11 01:27:58 +01:00
cli: fix buffer overflow in (currently unused!) code for progress bars.
It's only used in the test framework. Reported-by: @cdecker Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
parent
87a0cb1603
commit
a6db22ece2
1 changed files with 1 additions and 1 deletions
|
@ -544,7 +544,7 @@ static bool handle_notify(const char *buf, jsmntok_t *toks,
|
|||
snprintf(totstr, sizeof(totstr), "%u", tot);
|
||||
printf("%*u/%s ", (int)strlen(totstr), n+1, totstr);
|
||||
memset(bar, ' ', sizeof(bar)-1);
|
||||
memset(bar, '=', (double)strlen(bar) / (tot-1) * n);
|
||||
memset(bar, '=', (double)(sizeof(bar)-1) / (tot-1) * n);
|
||||
bar[sizeof(bar)-1] = '\0';
|
||||
printf("|%s|", bar);
|
||||
/* Leave bar there if it's finished. */
|
||||
|
|
Loading…
Add table
Reference in a new issue