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=5a89b2ea0d25ce42047c5183b818449538dffd98;p=rrdtool.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/branches/1.3/program@2030 a5681a0c-68f1-0310-ab6d-d61299d08faa --- diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index d9a0e96..2256702 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -989,7 +989,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()) + @@ -1002,10 +1005,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(