diff options
author | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
---|---|---|
committer | sjg <sjg@FreeBSD.org> | 2015-05-27 01:19:58 +0000 |
commit | 65145fa4c81da358fcbc3b650156dab705dfa34e (patch) | |
tree | 55c065b6730aaac2afb6c29933ee6ec5fa4c4249 /usr.bin/ministat | |
parent | 60ff4eb0dff94a04d75d0d52a3957aaaf5f8c693 (diff) | |
parent | e6b664c390af88d4a87208bc042ce503da664c3b (diff) | |
download | FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.zip FreeBSD-src-65145fa4c81da358fcbc3b650156dab705dfa34e.tar.gz |
Merge sync of head
Diffstat (limited to 'usr.bin/ministat')
-rw-r--r-- | usr.bin/ministat/Makefile | 8 | ||||
-rw-r--r-- | usr.bin/ministat/ministat.1 | 4 | ||||
-rw-r--r-- | usr.bin/ministat/ministat.c | 6 |
3 files changed, 9 insertions, 9 deletions
diff --git a/usr.bin/ministat/Makefile b/usr.bin/ministat/Makefile index e4c2f07..2a63797 100644 --- a/usr.bin/ministat/Makefile +++ b/usr.bin/ministat/Makefile @@ -1,13 +1,13 @@ # $FreeBSD$ PROG= ministat -DPADD= ${LIBM} -LDADD= -lm + +LIBADD= m .include <bsd.prog.mk> test: ${PROG} - ./${PROG} < ${.CURDIR}/chameleon - ./${PROG} ${.CURDIR}/chameleon + ./${PROG} < ${.CURDIR}/chameleon + ./${PROG} ${.CURDIR}/chameleon ./${PROG} ${.CURDIR}/iguana ${.CURDIR}/chameleon ./${PROG} -c 80 ${.CURDIR}/iguana ${.CURDIR}/chameleon ./${PROG} -s -c 80 ${.CURDIR}/chameleon ${.CURDIR}/iguana diff --git a/usr.bin/ministat/ministat.1 b/usr.bin/ministat/ministat.1 index ea31c23..f713bae 100644 --- a/usr.bin/ministat/ministat.1 +++ b/usr.bin/ministat/ministat.1 @@ -68,7 +68,9 @@ See .Xr strtok 3 for details. .It Fl w Ar width -Width of ASCII-art plot in characters, default is 74. +Width of ASCII-art plot in characters. +The default is the terminal width, or 74 if standard output is not a +terminal. .El .Pp A sample output could look like this: diff --git a/usr.bin/ministat/ministat.c b/usr.bin/ministat/ministat.c index c8d8e12..4c0ddd0 100644 --- a/usr.bin/ministat/ministat.c +++ b/usr.bin/ministat/ministat.c @@ -329,10 +329,8 @@ PlotSet(struct dataset *ds, int val) else bar = 0; - if (pl->bar == NULL) { - pl->bar = malloc(sizeof(char *) * pl->num_datasets); - memset(pl->bar, 0, sizeof(char*) * pl->num_datasets); - } + if (pl->bar == NULL) + pl->bar = calloc(sizeof(char *), pl->num_datasets); if (pl->bar[bar] == NULL) { pl->bar[bar] = malloc(pl->width); memset(pl->bar[bar], 0, pl->width); |