From ee0d1f510efa666471925532b507d4ec233ba7e1 Mon Sep 17 00:00:00 2001 From: oetiker Date: Sat, 1 Mar 2003 22:25:56 +0000 Subject: [PATCH] realy suppress size output when talking to stdout. Patch from Mat Zimmerman @ debian git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@189 a5681a0c-68f1-0310-ab6d-d61299d08faa --- src/rrd_tool.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rrd_tool.c b/src/rrd_tool.c index 1795c84..0378940 100644 --- a/src/rrd_tool.c +++ b/src/rrd_tool.c @@ -583,12 +583,13 @@ int HandleInputLine(int argc, char **argv, FILE* out) const char *imgfile = argv[2]; /* rrd_graph changes argv pointer */ int xsize, ysize; int i; + int tostdout = (strcmp(argv[2],"-") == 0); if( rrd_graph(argc-1, &argv[1], &calcpr, &xsize, &ysize) != -1 ) { - if (strcmp(imgfile,"-") != 0) + if (!tostdout) printf ("%dx%d\n",xsize,ysize); if (calcpr) { for(i=0;calcpr[i];i++){ - if (strcmp(imgfile,"-") != 0) + if (!tostdout) printf("%s\n",calcpr[i]); free(calcpr[i]); } -- 2.30.2