From d48fb6bb14ace3c2b3c321166cbb5ca5bbadf5b0 Mon Sep 17 00:00:00 2001 From: Chengwei Yang Date: Thu, 15 Aug 2013 15:59:37 +0800 Subject: [PATCH v2 7/7] Align behavior with document The API document says * If address_problem_type and address_problem_field are not #NULL, * sets an error message about how the field is no good. Otherwise, sets * address_problem_other as the error message. This change align code with document, because if address_problem_field is #NULL, we'll get error message like "Server address of type %s was missing argument (null)" This looks not very helpful but a little confusing. --- dbus/dbus-address.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dbus/dbus-address.c b/dbus/dbus-address.c index c4cfbbe..b49bac4 100644 --- a/dbus/dbus-address.c +++ b/dbus/dbus-address.c @@ -67,7 +67,7 @@ _dbus_set_bad_address (DBusError *error, const char *address_problem_field, const char *address_problem_other) { - if (address_problem_type != NULL) + if (address_problem_type != NULL && address_problem_field != NULL) dbus_set_error (error, DBUS_ERROR_BAD_ADDRESS, "Server address of type %s was missing argument %s", address_problem_type, address_problem_field); -- 1.7.9.5