Commit 6c2f698a authored by Hisham Muhammad's avatar Hisham Muhammad
Browse files

Merge pull request #458 from Explorer09/bar-tweaks

BarMeterMode_draw() minor code improvement
parents 3a4c0fa2 7b3c8bc7
...@@ -287,11 +287,8 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) { ...@@ -287,11 +287,8 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
char bar[w + 1]; char bar[w + 1];
int blockSizes[10]; int blockSizes[10];
for (int i = 0; i < w; i++)
bar[i] = ' ';
const size_t barOffset = w - MIN((int)strlen(buffer), w); snprintf(bar, w + 1, "%*s", w, buffer);
snprintf(bar + barOffset, w - barOffset + 1, "%s", buffer);
// First draw in the bar[] buffer... // First draw in the bar[] buffer...
int offset = 0; int offset = 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment