summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorDaniel Friesel <daniel.friesel@uos.de>2019-07-01 12:45:05 +0200
committerDaniel Friesel <daniel.friesel@uos.de>2019-07-01 12:45:05 +0200
commit3866ed99648c59940f39d21e6746cbb7dc64bba6 (patch)
treed9989ff21d455dba5c0516af5bef6df8b58a37f2 /src/lib
parent5981641a3715468f60518a2f4fef45e5848a8d1e (diff)
XDR: Fix string alignment
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/xdr.cc4
-rw-r--r--src/lib/xdr16.cc4
2 files changed, 4 insertions, 4 deletions
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 <uint32_t TSize>
@@ -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 <uint16_t TSize>
@@ -116,7 +116,7 @@ void XDRWriter::put(char const (&data)[TSize])
{
*buffer++ = 0;
}
- pos += i;
+ pos += i - 1;
}
uint16_t XDRReader::get_uint16()