[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[lvm-devel] [PATCH 15/23] Add test check for find_config_str



It looks like there should be some error code returned from _read_desc
when something fails.

Signed-off-by: Zdenek Kabelac <zkabelac redhat com>
---
 lib/format_text/import_vsn1.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/format_text/import_vsn1.c b/lib/format_text/import_vsn1.c
index e5e83d4..5a2d664 100644
--- a/lib/format_text/import_vsn1.c
+++ b/lib/format_text/import_vsn1.c
@@ -842,9 +842,9 @@ static void _read_desc(struct dm_pool *mem,
 	old_suppress = log_suppress(1);
 	d = find_config_str(cft->root, "description", "");
 	log_suppress(old_suppress);
-	*desc = dm_pool_strdup(mem, d);
+	*desc = (d) ? dm_pool_strdup(mem, d) : NULL;
 
-	get_config_uint32(cft->root, "creation_time", &u);
+	(void) get_config_uint32(cft->root, "creation_time", &u);
 	*when = u;
 }
 
-- 
1.7.3.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]