diff options
author | Havoc Pennington <hp@redhat.com> | 2003-03-31 20:56:29 +0000 |
---|---|---|
committer | Havoc Pennington <hp@redhat.com> | 2003-03-31 20:56:29 +0000 |
commit | fa05de9230d62e7c427b5313796fc6ccd4d0ff60 (patch) | |
tree | 206890e8df6a575c150b901bf108b1c0a1e98824 /bus/connection.c | |
parent | 7af59334331fbd097a24c4942c75181882b96747 (diff) | |
download | dbus-fa05de9230d62e7c427b5313796fc6ccd4d0ff60.tar.gz |
2003-03-31 Havoc Pennington <hp@redhat.com>
Fix some annoying DBusString API and fix all affected code.
* dbus/dbus-string.c (_dbus_string_init): get rid of annoying
max_length argument
(_dbus_string_get_data): change to return string instead of using
an out param
(_dbus_string_get_const_data): ditto
(_dbus_string_get_data_len): ditto
(_dbus_string_get_const_data_len): ditto
Diffstat (limited to 'bus/connection.c')
-rw-r--r-- | bus/connection.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/bus/connection.c b/bus/connection.c index ee7d183c..3d83d96c 100644 --- a/bus/connection.c +++ b/bus/connection.c @@ -732,20 +732,17 @@ dbus_bool_t bus_connection_set_name (DBusConnection *connection, const DBusString *name) { - const char *c_name; BusConnectionData *d; d = BUS_CONNECTION_DATA (connection); _dbus_assert (d != NULL); _dbus_assert (d->name == NULL); - _dbus_string_get_const_data (name, &c_name); - - d->name = _dbus_strdup (c_name); - - if (d->name == NULL) + if (!_dbus_string_copy_data (name, &d->name)) return FALSE; + _dbus_assert (d->name != NULL); + _dbus_verbose ("Name %s assigned to %p\n", d->name, connection); return TRUE; |