From 332e254255f3016e084fecb4103e4959cf24e632 Mon Sep 17 00:00:00 2001 From: oetiker Date: Mon, 15 Mar 2010 08:43:22 +0000 Subject: [PATCH] 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@2030 a5681a0c-68f1-0310-ab6d-d61299d08faa --- program/src/rrd_cgi.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/program/src/rrd_cgi.c b/program/src/rrd_cgi.c index d9a0e969..22567024 100644 --- a/program/src/rrd_cgi.c +++ b/program/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( -- 2.30.2