aboutsummaryrefslogtreecommitdiffstats
path: root/gadgets
diff options
context:
space:
mode:
authorgotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2007-08-18 06:10:00 +0000
committergotmor <gotmor@f2baff5b-bf2c-0410-a398-912abdc3d8b2>2007-08-18 06:10:00 +0000
commit97aff4bc50153a957f6b9510c3f0549dceab24ad (patch)
treeb5522903fb7e4c87dfc909e86286c79d35dd2b89 /gadgets
parent8ba334942e6d28505dbe256e231d562b279f0998 (diff)
downloaddzen-97aff4bc50153a957f6b9510c3f0549dceab24ad.tar.gz
dzen-97aff4bc50153a957f6b9510c3f0549dceab24ad.zip
fixes to gdbar.c and gcpubar.c
git-svn-id: http://dzen.googlecode.com/svn/trunk@159 f2baff5b-bf2c-0410-a398-912abdc3d8b2
Diffstat (limited to 'gadgets')
-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;