From: oetiker Date: Mon, 15 Mar 2010 08:43:22 +0000 (+0000) Subject: in rrd_cgi RRD::TIME::LAST do not raise argc when calling rrd_last since the strftime... X-Git-Url: https://git.octo.it/?p=rrdtool.git;a=commitdiff_plain;h=e2b6be3d2f9137c7f88229a1e087e7dc6c156755;hp=732528deae5d3d282ef07e2fbb9372f2270c3668 in rrd_cgi RRD::TIME::LAST do not raise argc when calling rrd_last since the strftime argument which is provided is already in the count but does not get passed to rrd_last. Thanks to Robert Luberda (fixing Debian Bug #573638.) git-svn-id: svn://svn.oetiker.ch/rrdtool/trunk/program@2030 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index f6313f8..1fabe70 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -988,7 +988,10 @@ char *printtimelast( if (buf == NULL) { return stralloc("[ERROR: allocating strftime buffer]"); }; - last = rrd_last(argc + 1, (char **) args - 1); + /* not raising argc in step with args - 1 since the last argument + will be used below for strftime */ + + last = rrd_last(argc, (char **) args - 1); if (rrd_test_error()) { char *err = malloc((strlen(rrd_get_error()) + @@ -1001,10 +1004,7 @@ char *printtimelast( strftime(buf, 254, args[1], &tm_last); return buf; } - if (argc < 2) { - return stralloc("[ERROR: too few arguments for RRD::TIME::LAST]"); - } - return stralloc("[ERROR: not enough arguments for RRD::TIME::LAST]"); + return stralloc("[ERROR: expected ]"); } char *printtimenow(