From 92f7d50b3b420670732a55bf15f7b343b2ce9fe6 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 21 Feb 2003 20:51:34 +0000 Subject: 2003-02-21 Anders Carlsson * dbus/dbus-marshal.c: (_dbus_demarshal_string_array): Make string arrays NULL-terminated. * dbus/dbus-memory.c: (dbus_free_string_array): * dbus/dbus-memory.h: New function for freeing NULL-terminated string arrays. * dbus/dbus-message-builder.c: (append_quoted_string), (_dbus_message_data_load): Add support for array types. * dbus/dbus-message.c: (check_message_handling): Add more types as test cases. * dbus/dbus-sysdeps.c: (_dbus_string_parse_int), (_dbus_string_parse_double): Add the start offset to the end offset. * test/data/valid-messages/lots-of-arguments.message: New test message with lots of arguments. --- dbus/dbus-memory.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'dbus/dbus-memory.c') diff --git a/dbus/dbus-memory.c b/dbus/dbus-memory.c index 11489c78..14ce23d8 100644 --- a/dbus/dbus-memory.c +++ b/dbus/dbus-memory.c @@ -220,4 +220,28 @@ dbus_free (void *memory) free (memory); } +/** + * Frees a #NULL-terminated array of strings. + * If passed #NULL, does nothing. + * + * @param str_array the array to be freed + */ +void +dbus_free_string_array (char **str_array) +{ + if (str_array) + { + int i; + + i = 0; + while (str_array[i]) + { + dbus_free (str_array[i]); + i++; + } + + dbus_free (str_array); + } +} + /** @} */ -- cgit