aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gadgets/gcpubar.c4
-rw-r--r--gadgets/gdbar.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/gadgets/gcpubar.c b/gadgets/gcpubar.c
index 7d52b69..b4c066d 100644
--- a/gadgets/gcpubar.c
+++ b/gadgets/gcpubar.c
@@ -48,7 +48,7 @@ pbar(double perc, int maxc, int height, int print_nl, int mode) {
int i, rp;
double l;
- l = perc * ((double)maxc / 100);
+ l = perc * ((mode ? (double)(maxc-2) : (double) maxc) / 100);
if((int)(l + 0.5) >= (int)l)
l = l + 0.5;
@@ -60,7 +60,7 @@ pbar(double perc, int maxc, int height, int print_nl, int mode) {
if(mode)
printf("CPU: %3d%% ^ib(1)^fg(%s)^ro(%dx%d)^p(%d)^fg(%s)^r(%dx%d)^fg()%s",
rp, bg, maxc, height, -1*(maxc-1),
- (rp>=CPUCRIT) ? CRITCOL : fg, (int)l-2, height-2, print_nl ? "\n" : "");
+ (rp>=CPUCRIT) ? CRITCOL : fg, (int)l, height-2, print_nl ? "\n" : "");
else
printf("CPU: %3d%% ^fg(%s)^r(%dx%d)^fg(%s)^r(%dx%d)^fg()%s",
rp, (rp>=CPUCRIT) ? CRITCOL : fg, (int)l, height,
diff --git a/gadgets/gdbar.c b/gadgets/gdbar.c
index 3466b4f..c5364f1 100644
--- a/gadgets/gdbar.c
+++ b/gadgets/gdbar.c
@@ -42,7 +42,7 @@ pbar(const char* label, double perc, int maxc, int height, int pnl, int mode) {
double l;
- l = perc * ((double)maxc / 100);
+ l = perc * ((mode ? (double)(maxc-2) : (double) maxc) / 100);
if((int)(l + 0.5) >= (int)l)
l = l + 0.5;