Reviewed By: dweatherford
git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@665065
13f79535-47bb-0310-9956-
ffa450edef68
// point and punt on the error
readState_.resetState(readState_.lastDispatchPtr_);
char errorMsg[1024];
- sprintf(errorMsg, "TFileTransport: log file corrupted at offset:%llu",
+ sprintf(errorMsg, "TFileTransport: log file corrupted at offset: %lu",
offset_ + readState_.lastDispatchPtr_);
perror(errorMsg);
throw TTransportException(errorMsg);
}
while (len > avail) {
bufferSize_ *= 2;
- buffer_ = (uint8_t*)realloc(buffer_, bufferSize_);
- if (buffer_ == NULL) {
- throw TTransportException("Out of memory.");
- }
+ avail = bufferSize_ - wPos_;
+ }
+ buffer_ = (uint8_t*)realloc(buffer_, bufferSize_);
+ if (buffer_ == NULL) {
+ throw TTransportException("Out of memory.");
}
}