Correct percentage formatting so it is always 3 characters wide.

This commit is contained in:
Andrew Wood
2023-10-11 22:22:53 +01:00
parent e864eca78d
commit 03fb1dc673
3 changed files with 3 additions and 1 deletions
+1 -1
View File
@@ -981,7 +981,7 @@ static const char *pv__format(pvstate_t state,
state->percentage = 0;
if (state->percentage > 100000)
state->percentage = 100000;
(void) pv_snprintf(pct, sizeof(pct), "%2ld%%", state->percentage);
(void) pv_snprintf(pct, sizeof(pct), "%3ld%%", state->percentage);
available_width = state->width - static_portion_size - strlen(pct) - 3;