mirror of https://github.com/xzeldon/htop.git
Merge pull request #458 from Explorer09/bar-tweaks
BarMeterMode_draw() minor code improvement
This commit is contained in:
commit
6c2f698a47
5
Meter.c
5
Meter.c
|
@ -287,11 +287,8 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
|
|||
char bar[w + 1];
|
||||
|
||||
int blockSizes[10];
|
||||
for (int i = 0; i < w; i++)
|
||||
bar[i] = ' ';
|
||||
|
||||
const size_t barOffset = w - MIN((int)strlen(buffer), w);
|
||||
snprintf(bar + barOffset, w - barOffset + 1, "%s", buffer);
|
||||
snprintf(bar, w + 1, "%*s", w, buffer);
|
||||
|
||||
// First draw in the bar[] buffer...
|
||||
int offset = 0;
|
||||
|
|
Loading…
Reference in New Issue