From 86d70795ed34fecb63f153592e75effeb0e82c2a Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Wed, 28 Sep 2011 13:23:29 +0100 Subject: [PATCH 03/10] Form a valid D-Bus error name if an unmapped error has a negative code Signed-off-by: Simon McVittie Bug: https://bugs.freedesktop.org/show_bug.cgi?id=40151 --- dbus/dbus-gobject.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/dbus/dbus-gobject.c b/dbus/dbus-gobject.c index 502dccf..e1cf91e 100644 --- a/dbus/dbus-gobject.c +++ b/dbus/dbus-gobject.c @@ -1519,7 +1519,8 @@ gerror_domaincode_to_dbus_error_name (const DBusGObjectInfo *object_info, g_free (uscored); } - g_string_append_printf (dbus_error_name, "Code%d", code); + /* Map -1 to (unsigned) -1 to avoid "-", which is not valid */ + g_string_append_printf (dbus_error_name, "Code%u", (unsigned) code); } else { -- 1.7.6.3