aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlan D. Brunelle <alan.brunelle@hp.com>2010-03-22 10:21:12 -0400
committerAlan D. Brunelle <alan.brunelle@hp.com>2010-03-22 10:21:12 -0400
commit6abaea7a340536c6afa5944e3fa63831729dfed3 (patch)
treebe8610738df76e1874d69fbdcf015ee3c923fd3c
parentc615ce2effdf4d3e75b503dd30617356c2bdef92 (diff)
downloadblktrace-6abaea7a340536c6afa5944e3fa63831729dfed3.tar.gz
Fixed incorrect sizeof instead of strlen in btt/rstats.c
-rw-r--r--btt/rstats.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/btt/rstats.c b/btt/rstats.c
index 71f010b..5a336fe 100644
--- a/btt/rstats.c
+++ b/btt/rstats.c
@@ -38,7 +38,7 @@ static LIST_HEAD(rstats);
static int do_open(struct files *fip, char *bn, char *pn)
{
- fip->nm = malloc(sizeof(bn) + 16);
+ fip->nm = malloc(strlen(bn) + 16);
sprintf(fip->nm, "%s_%s.dat", bn, pn);
fip->fp = my_fopen(fip->nm, "w");
@@ -55,6 +55,7 @@ static int init_rsip(struct rstat *rsip, struct d_info *dip)
{
char *nm = dip ? dip->dip_name : "sys";
+ rsip->base_sec = -1;
rsip->ios = rsip->nblks = 0;
if (do_open(&rsip->files[0], nm, "iops_fp") ||
do_open(&rsip->files[1], nm, "mbps_fp"))