#include <rrd_tool.h>
#include <rrd_format.h>
-
+extern int Tclrrd_Init(Tcl_Interp *interp, int safe);
extern int __getopt_initialized;
/*
* some rrd_XXX() functions might modify the argv strings passed to it.
- * Furthermore, they use getopt() without initializing getopt's optind
- * variable themselves. Hence, we need to do some preparation before
+ * Hence, we need to do some preparation before
* calling the rrd library functions.
*/
static char ** getopt_init(argc, argv)
char **argv2;
int i;
- optind = 0;
-
argv2 = calloc(argc, sizeof(char *));
for (i = 0; i < argc; i++) {
argv2[i] = strdup(argv[i]);
int argc;
char *argv[];
{
- time_t start, end;
+ time_t start, end, j;
unsigned long step, ds_cnt, i, ii;
rrd_value_t *data, *datai;
char **ds_namv;
&ds_cnt, &ds_namv, &data) != -1) {
datai = data;
listPtr = Tcl_GetObjResult(interp);
- for (i = start; i <= end; i += step) {
+ for (j = start; j <= end; j += step) {
for (ii = 0; ii < ds_cnt; ii++) {
sprintf(s, "%.2f", *(datai++));
Tcl_ListObjAppendElement(interp, listPtr,