Commit 4e233d93 authored by Steven Murray's avatar Steven Murray
Browse files

Fixed ia bug that I introduced into the CTA command-line tool

when I modified it to read results back in a
"read until end of file" loop.

The bug was that instead of trying to read 1 KiB chunks of data
from the cta front-end, the chunk size was only 8 bytes (the size
of 64-bit pointer).  The calculation of the chunk size was

   sizeof(buf - 1)

instead of:

   sizeof(buf) - 1
parent c8eefb01
......@@ -161,7 +161,7 @@ int sendCommand(const int argc, const char **argv) {
bytesRead = 0;
char buf[1024];
memset(buf, 0, sizeof(buf));
const XrdCl::XRootDStatus readStatus = xrootFile.Read(readOffset, sizeof(buf - 1), buf, bytesRead);
const XrdCl::XRootDStatus readStatus = xrootFile.Read(readOffset, sizeof(buf) - 1, buf, bytesRead);
if(!readStatus.IsOK()) {
throw std::runtime_error(std::string("Failed to read ") + cmdPath + ": " + readStatus.ToStr());
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment