aboutsummaryrefslogtreecommitdiffstats
path: root/Meter.c
diff options
context:
space:
mode:
Diffstat (limited to 'Meter.c')
-rw-r--r--Meter.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/Meter.c b/Meter.c
index 52dbdd9..05a4eb2 100644
--- a/Meter.c
+++ b/Meter.c
@@ -287,7 +287,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
int blockSizes[10];
- xSnprintf(bar, w + 1, "%*s", w, buffer);
+ xSnprintf(bar, w + 1, "%*.*s", w, w, buffer);
// First draw in the bar[] buffer...
int offset = 0;
@@ -359,7 +359,7 @@ static int GraphMeterMode_pixPerRow;
static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
if (!this->drawData) this->drawData = xCalloc(1, sizeof(GraphData));
- GraphData* data = (GraphData*) this->drawData;
+ GraphData* data = (GraphData*) this->drawData;
const int nValues = METER_BUFFER_LEN;
#ifdef HAVE_LIBNCURSESW
@@ -404,7 +404,7 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
k = -i/2;
i = 0;
}
- for (; i < nValues; i+=2, k++) {
+ for (; i < nValues - 1; i+=2, k++) {
int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT;
int v1 = CLAMP((int) lround(data->values[i] * pix), 1, pix);
int v2 = CLAMP((int) lround(data->values[i+1] * pix), 1, pix);

© 2014-2024 Faster IT GmbH | imprint | privacy policy