summaryrefslogtreecommitdiff
path: root/dbus/dbus-marshal-header.c
diff options
context:
space:
mode:
Diffstat (limited to 'dbus/dbus-marshal-header.c')
-rw-r--r--dbus/dbus-marshal-header.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/dbus/dbus-marshal-header.c b/dbus/dbus-marshal-header.c
index ec98a5ee..896e3ce1 100644
--- a/dbus/dbus-marshal-header.c
+++ b/dbus/dbus-marshal-header.c
@@ -1462,14 +1462,20 @@ void
_dbus_header_byteswap (DBusHeader *header,
int new_order)
{
+ unsigned char byte_order;
+
if (header->byte_order == new_order)
return;
+ byte_order = _dbus_string_get_byte (&header->data, BYTE_ORDER_OFFSET);
+ _dbus_assert (header->byte_order == byte_order);
+
_dbus_marshal_byteswap (&_dbus_header_signature_str,
0, header->byte_order,
new_order,
&header->data, 0);
+ _dbus_string_set_byte (&header->data, BYTE_ORDER_OFFSET, new_order);
header->byte_order = new_order;
}