remove debug, fix usage, do not die on invalid value - ploot - simple plotting tools
(HTM) git clone git://bitreich.org/ploot git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/ploot
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) Tags
(DIR) README
(DIR) LICENSE
---
(DIR) commit 3a13739bbf95aa2caa1b36afa5f685fac0f0f824
(DIR) parent 1a593aa504c78dbc507ed118a004cff811620065
(HTM) Author: Josuah Demangeon <mail@josuah.net>
Date: Tue, 8 May 2018 15:32:49 +0200
remove debug, fix usage, do not die on invalid value
Diffstat:
M Makefile | 4 ++--
M plootxt.c | 5 ++---
2 files changed, 4 insertions(+), 5 deletions(-)
---
(DIR) diff --git a/Makefile b/Makefile
@@ -7,6 +7,7 @@ PLOOT_OBJ = $(PLOOT_SRC:.c=.o)
PLOOTXT_SRC = plootxt.c util.c
PLOOTXT_OBJ = $(PLOOTXT_SRC:.c=.o)
+
LIB = -lm
all:V ploot plootxt
@@ -22,10 +23,9 @@ install:V ploot plootxt
cp ploot plootxt ${PREFIX}/bin
clean:V
- rm -f *.o ploot
+ rm -f *.o
V: # :V acts like .PHONY:
$(PLOOT_SRC) $(PLOOTXT_SRC): \
arg.h ploot.h util.h font.h font_14x7.h
-
(DIR) diff --git a/plootxt.c b/plootxt.c
@@ -65,7 +65,7 @@ plot_row(long *out, char *line, double *max, int nrow, int ncol)
for (n = 0; (tok = strsep(&line, ",")) != NULL; n++) {
if (n >= ncol)
fputs("too many values\n", stderr), exit(1);
- val = eatof(tok);
+ val = atof(tok);
plot_val(out + n * width, val, max[n], nrow);
}
if (n < ncol)
@@ -192,7 +192,6 @@ fmt_labels(char out[LINE_MAX], int ncol, char *labels[LINE_MAX / 2])
{
int i, n;
- printf("%d\n", width);
for (i = 0; i < ncol; labels++, i++) {
n = LINE_MAX - (width + sizeof("│")) * i;
out += snprintf(out, n, "│%-*s", width - 1, *labels);
@@ -202,7 +201,7 @@ fmt_labels(char out[LINE_MAX], int ncol, char *labels[LINE_MAX / 2])
static void
usage(void)
{
- fprintf(stderr, "usage: [-w width] %s maxval... <csv\n", argv0);
+ fprintf(stderr, "usage: %s [-w width] maxval... <csv\n", argv0);
exit(1);
}