Skip to content
Snippets Groups Projects
Commit 19e49892 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
incorrectly:

   sizeof(buf - 1)

instead of:

   sizeof(buf) - 1
parent 54c8189b
No related branches found
No related tags found
No related merge requests found
......@@ -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());
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment