dbus-pcap: Adjust offset by the length of the alignment
As we have a a bytes() rather than an iterator we can measure the length
of the achieved alignment size rather than assuming the requested
alignment size.
Signed-off-by: Andrew Jeffery <andrew@aj.id.au>
Change-Id: Ida0448d7a3b51e98ed3d547cb70e8689372f37c0
diff --git a/dbus-pcap/dbus-pcap b/dbus-pcap/dbus-pcap
index 11ae253..7d50aef 100755
--- a/dbus-pcap/dbus-pcap
+++ b/dbus-pcap/dbus-pcap
@@ -169,7 +169,7 @@
prop = TypePropertyLookup[prop.nature.value]
advance = (prop.nature - (self.offset & (prop.nature - 1))) % prop.nature
_ = bytes(islice(self.stream, advance))
- self.offset += advance
+ self.offset += len(_)
def take(self, size):
val = islice(self.stream, size)