From 449538d860c59e3924d24ba608f85eb712962be4 Mon Sep 17 00:00:00 2001 From: Beniamino Galvani Date: Wed, 26 Jun 2019 17:57:06 +0200 Subject: [PATCH] clients: fix printing hexadecimal enum values Use the 'x' conversion specifier for hexadecimal numbers. Fixes: f53218ed7cd7 ('cli: add property type for enum and showcase for ipv6.addr-gen-mode'): (cherry picked from commit 420554a72ec9d408c158a9d4878ff401c2568559) (cherry picked from commit 9fe7ef6ca310e756ac54517de8e17a6f3fd83939) (cherry picked from commit d4141a1806a4eb27d1b4e7b874f0095fe15bec3e) --- clients/common/nm-meta-setting-desc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/clients/common/nm-meta-setting-desc.c b/clients/common/nm-meta-setting-desc.c index d13ee4cea5..bc428e9526 100644 --- a/clients/common/nm-meta-setting-desc.c +++ b/clients/common/nm-meta-setting-desc.c @@ -1000,7 +1000,7 @@ _get_fcn_gobject_enum (ARGS_GET_FCN) s = format_numeric_hex || ( format_numeric_hex_unknown && !G_IS_ENUM_CLASS (gtype_class ?: (gtype_class = g_type_class_ref (gtype)))) - ? g_strdup_printf ("0x%"G_GINT64_FORMAT, v) + ? g_strdup_printf ("0x%"G_GINT64_MODIFIER"x", v) : g_strdup_printf ("%"G_GINT64_FORMAT, v); RETURN_STR_TO_FREE (g_steal_pointer (&s)); } @@ -1018,7 +1018,7 @@ _get_fcn_gobject_enum (ARGS_GET_FCN) if ( format_numeric_hex || ( format_numeric_hex_unknown && !G_IS_ENUM_CLASS (gtype_class ?: (gtype_class = g_type_class_ref (gtype))))) - nm_sprintf_buf (s_numeric, "0x%"G_GINT64_FORMAT, v); + nm_sprintf_buf (s_numeric, "0x%"G_GINT64_MODIFIER"x", v); else nm_sprintf_buf (s_numeric, "%"G_GINT64_FORMAT, v);