summaryrefslogtreecommitdiffstats
path: root/usr.bin/ministat
diff options
context:
space:
mode:
authorphk <phk@FreeBSD.org>2003-08-18 11:13:19 +0000
committerphk <phk@FreeBSD.org>2003-08-18 11:13:19 +0000
commit9a9a510c2c85c77f33dfc15ee93e867ca587a42d (patch)
tree02786b2abbbc8c969ba7fd847c37a98a46ac8a61 /usr.bin/ministat
parent49037ec1b200d71eb93decf5b78b2d3449224487 (diff)
downloadFreeBSD-src-9a9a510c2c85c77f33dfc15ee93e867ca587a42d.zip
FreeBSD-src-9a9a510c2c85c77f33dfc15ee93e867ca587a42d.tar.gz
In case of zero span data supress the histogram plot.
Diffstat (limited to 'usr.bin/ministat')
-rw-r--r--usr.bin/ministat/ministat.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c
index 4b7c6a0..b8ca72a 100644
--- a/usr.bin/ministat/ministat.c
+++ b/usr.bin/ministat/ministat.c
@@ -328,6 +328,8 @@ PlotSet(struct dataset *ds, int val)
int i, j, m, x;
pl = &plot;
+ if (pl->span == 0)
+ return;
m = 1;
i = -1;
j = 0;
@@ -380,6 +382,10 @@ DumpPlot(void)
int i, j, k;
pl = &plot;
+ if (pl->span == 0) {
+ printf("[no plot, span is zero width]\n");
+ return;
+ }
putchar('+');
for (i = 0; i < pl->width; i++)
OpenPOWER on IntegriCloud