From ce57dd3ccbbf719e8fe056574fb071d4a694fbcc Mon Sep 17 00:00:00 2001 From: Philippe Proulx Date: Wed, 5 Jul 2017 19:12:57 -0400 Subject: [PATCH] lib/ctf-ir/clock-class.c: only serialize UUID if it is set MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Otherwise we get: uuid = "00000000-0000-0000-0000-000000000000"; Signed-off-by: Philippe Proulx Signed-off-by: Jérémie Galarneau --- lib/ctf-ir/clock-class.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/lib/ctf-ir/clock-class.c b/lib/ctf-ir/clock-class.c index 7d02a989..751fe554 100644 --- a/lib/ctf-ir/clock-class.c +++ b/lib/ctf-ir/clock-class.c @@ -556,12 +556,16 @@ void bt_ctf_clock_class_serialize(struct bt_ctf_clock_class *clock_class, g_string_append(context->string, "clock {\n"); g_string_append_printf(context->string, "\tname = %s;\n", clock_class->name->str); - g_string_append_printf(context->string, - "\tuuid = \"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\";\n", - uuid[0], uuid[1], uuid[2], uuid[3], - uuid[4], uuid[5], uuid[6], uuid[7], - uuid[8], uuid[9], uuid[10], uuid[11], - uuid[12], uuid[13], uuid[14], uuid[15]); + + if (clock_class->uuid_set) { + g_string_append_printf(context->string, + "\tuuid = \"%02x%02x%02x%02x-%02x%02x-%02x%02x-%02x%02x-%02x%02x%02x%02x%02x%02x\";\n", + uuid[0], uuid[1], uuid[2], uuid[3], + uuid[4], uuid[5], uuid[6], uuid[7], + uuid[8], uuid[9], uuid[10], uuid[11], + uuid[12], uuid[13], uuid[14], uuid[15]); + } + if (clock_class->description) { g_string_append_printf(context->string, "\tdescription = \"%s\";\n", clock_class->description->str); -- 2.34.1