From: Julien Thomas Date: Tue, 25 Jun 2013 11:22:40 +0000 (+0200) Subject: Allow empty imginfo string format X-Git-Tag: v1.5.0-rc1~175^2~2^2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=refs%2Fpull%2F402%2Fhead;p=thirdparty%2Frrdtool-1.x.git Allow empty imginfo string format Commit 37d3050 "Added imginfo format check" breaks -f "" which used to be very usefull to print data as text format on stdout. Allowing an empty -f was particularly interesting because there was no x printed out. Before : [root@nagios-2b ~]# rrdtool graph /dev/null -f "" --start -1d \ DEF:d=/var/lib/rrd/nagios-2b/load.rrd:load5:AVERAGE \ VDEF:v=d,AVERAGE \ PRINT:v:%.6lf 5.284605 After : [root@nagios-2b ~]# rrdtool graph /dev/null -f "" --start -1d \ DEF:d=/var/lib/rrd/nagios-2b/load.rrd:load5:AVERAGE \ VDEF:v=d,AVERAGE \ PRINT:v:%.6lf ERROR: bad format for imginfo --- diff --git a/src/rrd_graph.c b/src/rrd_graph.c index e714e4f4..4d91793a 100644 --- a/src/rrd_graph.c +++ b/src/rrd_graph.c @@ -4139,7 +4139,7 @@ rrd_info_t *rrd_graph_v( ** Also, if needed, print a line with information about the image. */ - if (im.imginfo) { + if (im.imginfo && *im.imginfo) { rrd_infoval_t info; char *path; char *filename;