mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-05-22 07:41:20 -04:00
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:
parent
afe62dad28
commit
5a4d517188
1 changed files with 7 additions and 0 deletions
|
@ -167,6 +167,13 @@ void PGPHandler::initCertificateInfo(PGPCertificateInfo& cert,const ops_keydata_
|
||||||
uint32_t i=0;
|
uint32_t i=0;
|
||||||
while(i < namestring.length() && namestring[i] != '(' && namestring[i] != '<') { cert._name += namestring[i] ; ++i ;}
|
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 ;
|
std::string& next = (namestring[i] == '(')?cert._comment:cert._email ;
|
||||||
++i ;
|
++i ;
|
||||||
next = "" ;
|
next = "" ;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue