{
char *buf;
time_t t;
+ char com[PATH_MAX];
t = time(NULL);
}
outf(f, "description = \"%s\"", dm_escape_double_quotes(buf, desc));
outnl(f);
- outf(f, "creation_host = \"%s\"\t# %s %s %s %s %s", _utsname.nodename,
- _utsname.sysname, _utsname.nodename, _utsname.release,
- _utsname.version, _utsname.machine);
+ (void) dm_snprintf(com, sizeof(com), "# %s %s %s %s %s",
+ _utsname.sysname, _utsname.nodename, _utsname.release,
+ _utsname.version, _utsname.machine);
+ outfc(f, com, "creation_host = \"%s\"", _utsname.nodename);
outf(f, "creation_time = %lu\t# %s", t, ctime(&t));
return 1;
outf(f, "seqno = %u", vg->seqno);
if (vg->fid && vg->fid->fmt)
- outf(f, "format = \"%s\" # informational", vg->fid->fmt->name);
+ outfc(f, "# informational", "format = \"%s\"", vg->fid->fmt->name);
if (!_print_flag_config(f, vg->status, VG_FLAGS))
return_0;
static int _striped_text_export(const struct lv_segment *seg, struct formatter *f)
{
- outf(f, "stripe_count = %u%s", seg->area_count,
- (seg->area_count == 1) ? "\t# linear" : "");
+ outfc(f, (seg->area_count == 1) ? "# linear" : NULL,
+ "stripe_count = %u", seg->area_count);
if (seg->area_count > 1)
outsize(f, (uint64_t) seg->stripe_size,