From 3b3c7c7ba4d66e44a5888361baa2eeb748f512a4 Mon Sep 17 00:00:00 2001 From: drbob Date: Tue, 8 Sep 2009 23:41:57 +0000 Subject: [PATCH] * Bad loading by TlvString - fixed. * Enabled extra debugging in rstlvtypes as extra check git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1622 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/serialiser/rstlvbase.cc | 2 +- libretroshare/src/serialiser/rstlvtypes.cc | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/libretroshare/src/serialiser/rstlvbase.cc b/libretroshare/src/serialiser/rstlvbase.cc index 7c96ced48..d4674b1a5 100644 --- a/libretroshare/src/serialiser/rstlvbase.cc +++ b/libretroshare/src/serialiser/rstlvbase.cc @@ -447,7 +447,7 @@ bool GetTlvString(void *data, uint32_t size, uint32_t *offset, return false; } - char *strdata = (char *) right_shift_void_pointer(tlvstart, 4); + char *strdata = (char *) right_shift_void_pointer(tlvstart, TLV_HEADER_SIZE); uint16_t strsize = tlvsize - TLV_HEADER_SIZE; /* remove the header */ in = std::string(strdata, strsize); diff --git a/libretroshare/src/serialiser/rstlvtypes.cc b/libretroshare/src/serialiser/rstlvtypes.cc index 2cdbb6c6d..1a489ff53 100644 --- a/libretroshare/src/serialiser/rstlvtypes.cc +++ b/libretroshare/src/serialiser/rstlvtypes.cc @@ -33,6 +33,8 @@ #include #include +#define TLV_DEBUG 1 + void RsTlvItem::TlvShallowClear() { TlvClear(); /* unless overloaded! */