X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Frrd_cgi.c;h=8ce7fba3792150fdd22c53b7c548e3497c34a7ef;hb=3501907ea29f921eefcae6bd50c3f31eca0e49b2;hp=f6313f869dc0cc725e39e9107283a275571b8a8b;hpb=609630f90a3247ae0956eb4f6d860e8a7f1797f6;p=rrdtool.git diff --git a/src/rrd_cgi.c b/src/rrd_cgi.c index f6313f8..8ce7fba 100644 --- a/src/rrd_cgi.c +++ b/src/rrd_cgi.c @@ -1,5 +1,5 @@ /***************************************************************************** - * RRDtool 1.4.2 Copyright by Tobi Oetiker, 1997-2009 + * RRDtool 1.4.3 Copyright by Tobi Oetiker, 1997-2010 ***************************************************************************** * rrd_cgi.c RRD Web Page Generator *****************************************************************************/ @@ -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(