Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Value returned by XRootDStatus::ToStr() includes an embedded NULL #1416

Closed
slithy opened this issue Mar 2, 2021 · 2 comments
Closed

Value returned by XRootDStatus::ToStr() includes an embedded NULL #1416

slithy opened this issue Mar 2, 2021 · 2 comments

Comments

@slithy
Copy link

slithy commented Mar 2, 2021

In XrdClXRootDResponses.hh, method XRootDStatus::ToStr() :

The std::string returned by this method includes an extra NULL character at the end.

This causes problems with code such as the following:

os << status.ToStr() << " code:" << status.code << " errNo:" << status.errNo << " status:" << status.status;

which gives output:

[ERROR] Server responded with an error: [3007] Unable to read file - wrong file checksum fn= /fst/00000000/0000003e; input/output error\u0000\n code:400 errNo:3007 status:1

(note the extra \u0000 after "input/output error", which causes the output to be truncated).

Please remove this unwanted NULL from the end of ToStr(), thanks!

@simonmichal
Copy link
Contributor

Hi @slithy, thanks for reporting the problem! I think it has been already fixed in 22d308a

@slithy
Copy link
Author

slithy commented Mar 2, 2021

Thanks, I have implemented a workaround which will do the job until we upgrade to XRootD v5, so I'll close the ticket.

@slithy slithy closed this as completed Mar 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants