projects
/
rrdtool.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
added a nop control for string formating, so that strings ending in /x are possible...
[rrdtool.git]
/
src
/
rrd_cgi.c
diff --git
a/src/rrd_cgi.c
b/src/rrd_cgi.c
index
f6313f8
..
df4a9dc
100644
(file)
--- 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
*****************************************************************************/
*****************************************************************************
* rrd_cgi.c RRD Web Page Generator
*****************************************************************************/
@@
-9,6
+9,11
@@
#include <stdlib.h>
#endif
#include <stdlib.h>
#endif
+#ifdef WIN32
+ #define strcasecmp stricmp
+ #define strcasencmp strnicmp
+#endif
+
#define MEMBLK 1024
/*#define DEBUG_PARSER
#define DEBUG_VARS*/
#define MEMBLK 1024
/*#define DEBUG_PARSER
#define DEBUG_VARS*/
@@
-988,7
+993,10
@@
char *printtimelast(
if (buf == NULL) {
return stralloc("[ERROR: allocating strftime buffer]");
};
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()) +
if (rrd_test_error()) {
char *err =
malloc((strlen(rrd_get_error()) +
@@
-1001,10
+1009,7
@@
char *printtimelast(
strftime(buf, 254, args[1], &tm_last);
return buf;
}
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 <RRD::TIME::LAST file.rrd strftime-format>]");
}
char *printtimenow(
}
char *printtimenow(
@@
-1253,11
+1258,6
@@
int parse(
val = func(argc, (const char **) args);
free(args-1);
} else {
val = func(argc, (const char **) args);
free(args-1);
} else {
- /* unable to parse arguments, undo 0-termination by scanargs */
- for (; argc > 0; argc--) {
- *((args[argc - 1]) - 1) = ' ';
- }
-
/* next call, try parsing at current offset +1 */
end = (*buf) + i + 1;
/* next call, try parsing at current offset +1 */
end = (*buf) + i + 1;