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.tokkee.org/?a=commitdiff_plain;h=4d839872d13b0d4c477204d142c5bdd8b61571cb;p=rrdtool-all.git 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@2030 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index f6313f86..1fabe705 100644 --- a/program/src/rrd_cgi.c +++ b/program/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(