summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: c9a8ebb)
raw | patch | inline | side by side (parent: c9a8ebb)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 5 May 2005 09:07:56 +0000 (09:07 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 5 May 2005 09:07:56 +0000 (09:07 +0000) |
program/src/rrd_create.c | patch | blob | history |
index 1807dcabd24dcbf20330ae3f4f136b72ebb4040c..69ed8d87755eade19b3d78df3fab10e28044a237 100644 (file)
--- a/program/src/rrd_create.c
+++ b/program/src/rrd_create.c
return -1;
}
rrd.stat_head -> ds_cnt++;
- } else if (strncmp(argv[i],"RRA:",3)==0){
+ } else if (strncmp(argv[i],"RRA:",4)==0){
+ char *argvcopy;
char *tokptr;
size_t old_size = sizeof(rra_def_t)*(rrd.stat_head->rra_cnt);
if((rrd.rra_def = rrd_realloc(rrd.rra_def,
return(-1);
}
memset(&rrd.rra_def[rrd.stat_head->rra_cnt], 0, sizeof(rra_def_t));
-
- token = strtok_r(&argv[i][4],":", &tokptr);
+
+ argvcopy = strdup(argv[i]);
+ token = strtok_r(&argvcopy[4],":", &tokptr);
token_idx = error_flag = 0;
while (token != NULL)
{
if (rrd_test_error())
{
/* all errors are unrecoverable */
+ free(argvcopy);
rrd_free(&rrd);
return (-1);
}
token = strtok_r(NULL,":", &tokptr);
token_idx++;
} /* end while */
+ free(argvcopy);
#ifdef DEBUG
fprintf(stderr,"Creating RRA CF: %s, dep idx %lu, current idx %lu\n",
rrd.rra_def[rrd.stat_head->rra_cnt].cf_nam,