mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
export: add missed buffer initialization
Since we reduced emitting to single string list, we need to make sure empty list are not producing garbage strings.
This commit is contained in:
parent
056ad4a8f4
commit
ea39c58127
@ -394,6 +394,8 @@ static char *_alloc_printed_str_list(struct dm_list *list)
|
||||
return NULL;
|
||||
}
|
||||
|
||||
buffer[0];
|
||||
|
||||
dm_list_iterate_items(sl, list) {
|
||||
if (!emit_to_buffer(&buf, &size, "%s\"%s\"",
|
||||
(!first) ? ", " : "",
|
||||
@ -839,6 +841,7 @@ static int _alloc_printed_indirect_descendants(struct dm_list *indirect_glvs, ch
|
||||
return 0;
|
||||
}
|
||||
buf = *buffer;
|
||||
buf[0] = 0;
|
||||
|
||||
dm_list_iterate_items(user_glvl, indirect_glvs) {
|
||||
if (user_glvl->glv->is_historical)
|
||||
|
@ -145,6 +145,9 @@ int print_flags(char *buffer, size_t size, enum pv_vg_lv_e type, int mask, uint6
|
||||
if (!(flags = _get_flags(type)))
|
||||
return_0;
|
||||
|
||||
if (size)
|
||||
buffer[0] = 0;
|
||||
|
||||
for (f = 0; flags[f].mask; f++) {
|
||||
if (status & flags[f].mask) {
|
||||
status &= ~flags[f].mask;
|
||||
|
Loading…
Reference in New Issue
Block a user