From: David Reiss Date: Mon, 4 Feb 2008 19:24:00 +0000 (+0000) Subject: Thrift: Forgot to dereference a pointer. X-Git-Tag: 0.2.0~1015 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=20f009d6251af0f838c4ef8799d6b238cd230606;p=common%2Fthrift.git Thrift: Forgot to dereference a pointer. Summary: This didn't get updated when the interface changed, and the cast silenced the warning message. Stupid C. Reviewed By: mcslee Test Plan: Trust Chad Walters. Revert Plan: ok git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665457 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/cpp/src/transport/TZlibTransport.cpp b/lib/cpp/src/transport/TZlibTransport.cpp index ea0b0a4b..27aa350c 100644 --- a/lib/cpp/src/transport/TZlibTransport.cpp +++ b/lib/cpp/src/transport/TZlibTransport.cpp @@ -238,7 +238,7 @@ const uint8_t* TZlibTransport::borrow(uint8_t* buf, uint32_t* len) { // Don't try to be clever with shifting buffers. // If we have enough data, give a pointer to it, // otherwise let the protcol use its slow path. - if (readAvail() >= (int)len) { + if (readAvail() >= (int)*len) { *len = (uint32_t)readAvail(); return urbuf_ + urpos_; }