diff --git a/src/XrdCl/XrdClXRootDMsgHandler.cc b/src/XrdCl/XrdClXRootDMsgHandler.cc index d31f050e520..9a1f433bfb9 100644 --- a/src/XrdCl/XrdClXRootDMsgHandler.cc +++ b/src/XrdCl/XrdClXRootDMsgHandler.cc @@ -1225,9 +1225,7 @@ namespace XrdCl if( pStatus.code == errErrorResponse ) { st->errNo = rsp->body.error.errnum; - // omit the last character as the string returned from the server - // (acording to protocol specs) should be null-terminated - std::string errmsg( rsp->body.error.errmsg, rsp->hdr.dlen-5 ); + std::string errmsg( rsp->body.error.errmsg, rsp->hdr.dlen-4 ); if( st->errNo == kXR_noReplicas && !pLastError.IsOK() ) errmsg += " Last seen error: " + pLastError.ToString(); st->SetErrorMessage( errmsg );