Trim right spaces from certificate name.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5373 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-08-02 18:23:20 +00:00
parent afe62dad28
commit 5a4d517188

View File

@ -167,6 +167,13 @@ void PGPHandler::initCertificateInfo(PGPCertificateInfo& cert,const ops_keydata_
uint32_t i=0;
while(i < namestring.length() && namestring[i] != '(' && namestring[i] != '<') { cert._name += namestring[i] ; ++i ;}
// trim right spaces
std::string::size_type found = cert._name.find_last_not_of(' ');
if (found != std::string::npos)
cert._name.erase(found + 1);
else
cert._name.clear(); // all whitespace
std::string& next = (namestring[i] == '(')?cert._comment:cert._email ;
++i ;
next = "" ;