Fixed incorrect sizeof instead of strlen in btt/rstats.c
authorAlan D. Brunelle <alan.brunelle@hp.com>
Mon, 22 Mar 2010 14:21:12 +0000 (10:21 -0400)
committerAlan D. Brunelle <alan.brunelle@hp.com>
Mon, 22 Mar 2010 14:21:12 +0000 (10:21 -0400)
btt/rstats.c

index 71f010bfaa27bfbe6d0fbc170f64e85873996c5d..5a336fe44ecf059230d32c638acc6fe5d705e50d 100644 (file)
@@ -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"))