[PATCH] various fixes for marshlling empty fixed type arrays
Havoc Pennington
hp at redhat.com
Mon Feb 13 10:43:02 PST 2006
On Mon, 2006-02-13 at 16:16 +0200, Rob Taylor wrote:
> Sorry, I forgot to reply to this last week - I blame illness ;)
>
> There is an issue that _dbus_string_init_const_len will assert if value
> is NULL even if length is null, I'm not sure if this is correct or not..
>
Right, the assert would become something like (length == 0 || value !=
NULL) or something like that (depending on the original)
> I did the patch this way to avoid this call and as it'd be more
> efficient (not allocating, then freeing a 1 byte string). But you're
> quite right, this patch doesn't look quite right. What's your suggestion?
I wouldn't worry about the 1-byte alloc; we could always change
DBusString to avoid that someday if it turned out to matter. I'd just
focus on clean code.
Havoc
More information about the dbus
mailing list