diff options
author | Alasdair Kergon <agk@redhat.com> | 2008-04-19 15:50:18 +0000 |
---|---|---|
committer | Alasdair Kergon <agk@redhat.com> | 2008-04-19 15:50:18 +0000 |
commit | f44e3ff46aab56c4ffcd4e86f4786ed06bf82a02 (patch) | |
tree | 8c076b5ca19172c06d702c7c925a838bcc186ca8 /libdm/libdm-report.c | |
parent | 7e305eda2f6a6533f9d428756788bd286f3cf7a1 (diff) | |
download | lvm2-f44e3ff46aab56c4ffcd4e86f4786ed06bf82a02.tar.gz lvm2-f44e3ff46aab56c4ffcd4e86f4786ed06bf82a02.tar.xz lvm2-f44e3ff46aab56c4ffcd4e86f4786ed06bf82a02.zip |
Calculate string size within dm_pool_grow_object.
Diffstat (limited to 'libdm/libdm-report.c')
-rw-r--r-- | libdm/libdm-report.c | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/libdm/libdm-report.c b/libdm/libdm-report.c index d8bd791f..71004dd1 100644 --- a/libdm/libdm-report.c +++ b/libdm/libdm-report.c @@ -668,15 +668,13 @@ static int _report_headings(struct dm_report *rh) log_error("dm_report: Failed to generate report headings for printing"); goto bad; } - } else if (!dm_pool_grow_object(rh->mem, heading, - strlen(heading))) { + } else if (!dm_pool_grow_object(rh->mem, heading, 0)) { log_error("dm_report: Failed to generate report headings for printing"); goto bad; } if (!list_end(&rh->field_props, &fp->list)) - if (!dm_pool_grow_object(rh->mem, rh->separator, - strlen(rh->separator))) { + if (!dm_pool_grow_object(rh->mem, rh->separator, 0)) { log_error("dm_report: Failed to generate report headings for printing"); goto bad; } @@ -803,8 +801,7 @@ int dm_report_output(struct dm_report *rh) repstr = field->report_string; width = field->props->width; if (!(rh->flags & DM_REPORT_OUTPUT_ALIGNED)) { - if (!dm_pool_grow_object(rh->mem, repstr, - strlen(repstr))) { + if (!dm_pool_grow_object(rh->mem, repstr, 0)) { log_error("dm_report: Unable to extend output line"); goto bad; } @@ -836,8 +833,7 @@ int dm_report_output(struct dm_report *rh) } if (!list_end(&row->fields, fh)) - if (!dm_pool_grow_object(rh->mem, rh->separator, - strlen(rh->separator))) { + if (!dm_pool_grow_object(rh->mem, rh->separator, 0)) { log_error("dm_report: Unable to extend output line"); goto bad; } |