Skip to content

Commit

Permalink
Merge pull request #1063 from jthiltges/python_read_init
Browse files Browse the repository at this point in the history
[Python] Initialize bytesRead in Read() calls
  • Loading branch information
simonmichal committed Oct 7, 2019
2 parents 6b7ebea + f873dff commit ff17efa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions bindings/python/src/PyXRootDFile.cc
Expand Up @@ -193,7 +193,7 @@ namespace PyXRootD
}

else {
uint32_t bytesRead;
uint32_t bytesRead = 0;
async( status = self->file->Read( offset, size, buffer, bytesRead, timeout ) );
pyresponse = PyBytes_FromStringAndSize( buffer, bytesRead );
delete[] buffer;
Expand Down Expand Up @@ -363,7 +363,7 @@ namespace PyXRootD
XrdCl::XRootDStatus status;
XrdCl::Buffer *buffer;
XrdCl::Buffer *temp;
uint32_t bytesRead;
uint32_t bytesRead = 0;

temp = new XrdCl::Buffer( size );
status = self->file->Read( offset, size, temp->GetBuffer(), bytesRead );
Expand Down

0 comments on commit ff17efa

Please sign in to comment.