Thrift: TMemoryBuffer::getBufferAsString only returns written portion.
authorDavid Reiss <dreiss@apache.org>
Thu, 23 Aug 2007 17:20:38 +0000 (17:20 +0000)
committerDavid Reiss <dreiss@apache.org>
Thu, 23 Aug 2007 17:20:38 +0000 (17:20 +0000)
(This change was by Adam, diff sent by email, I'm just checking it in.)

Blame Rev: 55988

Reviewed By: adam

Test Plan: Thrift compiles.

Revert Plan: ok

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665219 13f79535-47bb-0310-9956-ffa450edef68

lib/cpp/src/transport/TTransportUtils.h

index 9499acd..518969f 100644 (file)
@@ -319,7 +319,7 @@ class TMemoryBuffer : public TTransport {
     if (buffer_ == NULL) {
       return "";
     }
-    return std::string((char*)buffer_, (std::string::size_type)bufferSize_);
+    return std::string((char*)buffer_, (std::string::size_type)wPos_);
   }
 
   void appendBufferToString(std::string& str) {