aboutsummaryrefslogtreecommitdiffstats
path: root/Meter.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2018-04-11 01:26:28 +0200
committerDaniel Lange <DLange@git.local>2018-04-11 01:52:54 +0200
commitdf568a576f7b44ac5a2b9b7222c7f39d9932f626 (patch)
treeb30ce33fd0d49398b52bf9a90b42304a7c32455a /Meter.c
parent2ee50d030178cede83eb9d0005fbc19f819d30fe (diff)
downloaddebian_htop-df568a576f7b44ac5a2b9b7222c7f39d9932f626.tar.gz
debian_htop-df568a576f7b44ac5a2b9b7222c7f39d9932f626.tar.bz2
debian_htop-df568a576f7b44ac5a2b9b7222c7f39d9932f626.zip
Imported Upstream version 2.2.0
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