From 4e4d0cb54a500cc4030bef2c6fa1bcca8ae53bb9 Mon Sep 17 00:00:00 2001 From: alexandrut Date: Sat, 19 Sep 2009 17:36:29 +0000 Subject: [PATCH] replace raw with tlv string functions for better visibility git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1664 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/serialiser/rsdiscitems.cc | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/libretroshare/src/serialiser/rsdiscitems.cc b/libretroshare/src/serialiser/rsdiscitems.cc index 513f42b27..dd941630f 100644 --- a/libretroshare/src/serialiser/rsdiscitems.cc +++ b/libretroshare/src/serialiser/rsdiscitems.cc @@ -644,8 +644,7 @@ std::ostream &RsDiscVersion::print(std::ostream &out, uint16_t indent) uint32_t RsDiscSerialiser::sizeVersion(RsDiscVersion *item) { uint32_t s = 8; /* header */ - s += 4; /* size in RawString() */ - s += item->version.length(); + s += GetTlvStringSize(item->version); return s; } @@ -673,7 +672,7 @@ bool RsDiscSerialiser::serialiseVersion(RsDiscVersion *item, void *data, uint32_ /* skip the header */ offset += 8; - ok &= setRawString(data, tlvsize, &offset, item->version); + ok &= SetTlvString(data, tlvsize, &offset, TLV_TYPE_STR_VALUE, item->version); if (offset != tlvsize) { @@ -726,7 +725,7 @@ RsDiscVersion *RsDiscSerialiser::deserialiseVersion(void *data, uint32_t *pktsiz /* skip the header */ offset += 8; - ok &= getRawString(data, rssize, &offset, item->version); + ok &= GetTlvString(data, rssize, &offset, TLV_TYPE_STR_VALUE, item->version); if (offset != rssize) {