summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFederico Mena Quintero <federico@novell.com>2009-03-18 16:17:00 -0600
committerColin Walters <walters@verbum.org>2009-05-06 12:51:18 -0400
commit73ec6964d7a14eba3ec7118041e48e0a21438e52 (patch)
treee94f520cf314a0806e22bc34b0b413c6f1139ff1
parent0f19140b527ee946dd368dde9314c5c5e9d24177 (diff)
bfo20738 - Return a useful error message from dbus_signature_validate()
Signed-off-by: Federico Mena Quintero <federico@novell.com>
-rw-r--r--dbus/dbus-signature.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/dbus/dbus-signature.c b/dbus/dbus-signature.c
index a8864f8b..c7f8d0e3 100644
--- a/dbus/dbus-signature.c
+++ b/dbus/dbus-signature.c
@@ -233,12 +233,18 @@ dbus_signature_validate (const char *signature,
{
DBusString str;
+ DBusValidity reason;
_dbus_string_init_const (&str, signature);
- if (_dbus_validate_signature (&str, 0, _dbus_string_get_length (&str)))
+ reason = _dbus_validate_signature_with_reason (&str, 0, _dbus_string_get_length (&str));
+
+ if (reason == DBUS_VALID)
return TRUE;
- dbus_set_error (error, DBUS_ERROR_INVALID_SIGNATURE, "Corrupt type signature");
- return FALSE;
+ else
+ {
+ dbus_set_error (error, DBUS_ERROR_INVALID_SIGNATURE, _dbus_validity_to_error_message (reason));
+ return FALSE;
+ }
}
/**