Thrift: TMemoryBuffer::getAppendBufferToString fix.

Summary:
Same fix as getBufferAsString

Blame Rev: 55988

Reviewed By: dreiss

Test Plan: Thrift compiles.

Revert Plan: ok


git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665222 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/cpp/src/transport/TTransportUtils.h b/lib/cpp/src/transport/TTransportUtils.h
index 518969f..1a40975 100644
--- a/lib/cpp/src/transport/TTransportUtils.h
+++ b/lib/cpp/src/transport/TTransportUtils.h
@@ -326,7 +326,7 @@
     if (buffer_ == NULL) {
       return;
     }
-    str.append((char*)buffer_, bufferSize_);
+    str.append((char*)buffer_, wPos_);
   }
 
   void resetBuffer() {