summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ae7f66b)
raw | patch | inline | side by side (parent: ae7f66b)
author | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 15 Mar 2007 21:10:18 +0000 (21:10 +0000) | ||
committer | oetiker <oetiker@a5681a0c-68f1-0310-ab6d-d61299d08faa> | |
Thu, 15 Mar 2007 21:10:18 +0000 (21:10 +0000) |
git-svn-id: svn://svn.oetiker.ch/rrdtool/branches/1.2/program@1021 a5681a0c-68f1-0310-ab6d-d61299d08faa
src/rrd_tool.c | patch | blob | history |
diff --git a/src/rrd_tool.c b/src/rrd_tool.c
index bb82c38fc3deb6a91a30dca1efa468422582353d..c987c91b85ea594c87b56a98b5183183810971ca 100644 (file)
--- a/src/rrd_tool.c
+++ b/src/rrd_tool.c
char **legend_v;
int enumds = 0;
int i;
- char *vtag = NULL;
- vtag = malloc( strlen(COL_DATA_TAG)+10);
+ size_t vtag_s = strlen(COL_DATA_TAG) + 10;
+ char *vtag = malloc(vtag_s);
for ( i = 2; i < argc; i++){
if (strcmp("--enumds", argv[i]) == 0)
enumds = 1;
for (j = 0; j < col_cnt; j++) {
rrd_value_t newval = DNAN;
if (enumds == 1)
- snprintf(vtag,sizeof(vtag),"%s%lu", COL_DATA_TAG, j);
+ snprintf(vtag,vtag_s,"%s%lu", COL_DATA_TAG, j);
else
- snprintf(vtag,sizeof(vtag),"%s",COL_DATA_TAG);
+ snprintf(vtag,vtag_s,"%s",COL_DATA_TAG);
newval = *ptr;
if(isnan(newval)){