From 3866ed99648c59940f39d21e6746cbb7dc64bba6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 1 Jul 2019 12:45:05 +0200 Subject: XDR: Fix string alignment --- src/lib/xdr.cc | 4 ++-- src/lib/xdr16.cc | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/lib/xdr.cc b/src/lib/xdr.cc index 10d265f..b44471f 100644 --- a/src/lib/xdr.cc +++ b/src/lib/xdr.cc @@ -83,7 +83,7 @@ void XDRWriter::put(char const *data) { *buffer++ = 0; } - pos += i; + pos += i - 1; } template @@ -102,7 +102,7 @@ void XDRWriter::put(char const (&data)[TSize]) { *buffer++ = 0; } - pos += i; + pos += i - 1; } uint32_t XDRReader::get_uint32() diff --git a/src/lib/xdr16.cc b/src/lib/xdr16.cc index a9442bb..b1fb7ca 100644 --- a/src/lib/xdr16.cc +++ b/src/lib/xdr16.cc @@ -97,7 +97,7 @@ void XDRWriter::put(char const *data) { *buffer++ = 0; } - pos += i; + pos += i - 1; } template @@ -116,7 +116,7 @@ void XDRWriter::put(char const (&data)[TSize]) { *buffer++ = 0; } - pos += i; + pos += i - 1; } uint16_t XDRReader::get_uint16() -- cgit v1.2.3