From 7f63fff9c4a4e82925227e94d1fa4ba4500ebc2b Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 2 Jul 2015 00:04:38 +0200 Subject: [PATCH] display: missed to count with 0 dm_snprintf() returns upon success the number of characters printed (excluding the null byte used to end output to strings). So add extra byte to preserve \0. This fixes regression when displaying more then a single lv name. --- WHATS_NEW | 1 + lib/display/display.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/WHATS_NEW b/WHATS_NEW index 6c539e656..1b5b0978f 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,5 +1,6 @@ Version 2.02.124 - ================================= + Fix regression when printing more lv names via display_lvname (2.02.122). Add missing error logging to unlock_vg and sync_local_dev_names callers. Version 2.02.123 - 30th June 2015 diff --git a/lib/display/display.c b/lib/display/display.c index 059bc8f2a..98433e745 100644 --- a/lib/display/display.c +++ b/lib/display/display.c @@ -109,7 +109,7 @@ const char *display_lvname(const struct logical_volume *lv) return NULL; } - lv->vg->cmd->display_lvname_idx += r; + lv->vg->cmd->display_lvname_idx += r + 1; return name; }