summaryrefslogtreecommitdiffstats
path: root/dbus/dbus-marshal-basic.c
diff options
context:
space:
mode:
authorHavoc Pennington <hp@redhat.com>2005-01-03 04:25:32 +0000
committerHavoc Pennington <hp@redhat.com>2005-01-03 04:25:32 +0000
commitec8e14cfd591aa020b199161bacb01d90c6fa158 (patch)
tree78a182061dd57c1ac7b86bb27977bbc0c3d877a2 /dbus/dbus-marshal-basic.c
parentf757adc7973f4f927436ff3261e463bd8d8f4a66 (diff)
just when the file was looking all beautiful, add horrible hacky code to
fixup array lengths after setting a value somewhere within the array.
Diffstat (limited to 'dbus/dbus-marshal-basic.c')
-rw-r--r--dbus/dbus-marshal-basic.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/dbus/dbus-marshal-basic.c b/dbus/dbus-marshal-basic.c
index bad7d117..17e2964d 100644
--- a/dbus/dbus-marshal-basic.c
+++ b/dbus/dbus-marshal-basic.c
@@ -383,6 +383,7 @@ _dbus_marshal_set_basic (DBusString *str,
break;
case DBUS_TYPE_INT32:
case DBUS_TYPE_UINT32:
+ pos = _DBUS_ALIGN_VALUE (pos, 4);
set_4_octets (str, pos, vp->u32, byte_order);
if (old_end_pos)
*old_end_pos = pos + 4;
@@ -393,14 +394,13 @@ _dbus_marshal_set_basic (DBusString *str,
case DBUS_TYPE_INT64:
case DBUS_TYPE_UINT64:
case DBUS_TYPE_DOUBLE:
- {
- set_8_octets (str, pos, *vp, byte_order);
- if (old_end_pos)
+ pos = _DBUS_ALIGN_VALUE (pos, 8);
+ set_8_octets (str, pos, *vp, byte_order);
+ if (old_end_pos)
*old_end_pos = pos + 8;
- if (new_end_pos)
- *new_end_pos = pos + 8;
- return TRUE;
- }
+ if (new_end_pos)
+ *new_end_pos = pos + 8;
+ return TRUE;
break;
case DBUS_TYPE_STRING:
case DBUS_TYPE_OBJECT_PATH: