From 26563d750fd49d13bdd0290bdd6cc83c5ffc19ce Mon Sep 17 00:00:00 2001 From: Mario Limonciello Date: Wed, 4 Sep 2019 15:33:46 -0500 Subject: [PATCH] fu-util-common: strip all trailing whitespace in XML description MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Before: ``` └─Thunderbolt controller in Dell dock: │ Device ID: 42b9e069d0b5515065cf4a32cec39552861439c9 │ Description: Updating the dock improves performance. │ │ Flags: updatable|require-ac|registered │ └─Thunderbolt controller Update: Version: 43.00 Summary: Update for the Thunderbolt controller within a Dell dock License: proprietary Size: 409.6 kB Vendor: Dell Inc. Flags: trusted-payload ``` After: ``` └─Thunderbolt controller in Dell dock: │ Device ID: 42b9e069d0b5515065cf4a32cec39552861439c9 │ Description: Updating the dock improves performance. │ Flags: updatable|require-ac|registered │ └─Thunderbolt controller Update: Version: 43.00 Summary: Update for the Thunderbolt controller within a Dell dock License: proprietary Size: 409.6 kB Vendor: Dell Inc. Flags: trusted-payload ``` --- src/fu-util-common.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/fu-util-common.c b/src/fu-util-common.c index 5766e71bc..37ea4b386 100644 --- a/src/fu-util-common.c +++ b/src/fu-util-common.c @@ -824,12 +824,8 @@ fu_util_convert_description (const gchar *xml, GError **error) g_set_object (&n, n2); } - /* remove extra newline */ - if (str->len > 0) - g_string_truncate (str, str->len - 1); - /* success */ - return g_string_free (g_steal_pointer (&str), FALSE); + return fu_common_strstrip (str->str); } static gchar *