mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
patch from sehraf to fix the ChatId::toStdString() method
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@7940 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
085c6b1932
commit
0d308ffa2e
@ -108,9 +108,9 @@ ChatId::ChatId(std::string str):
|
|||||||
{
|
{
|
||||||
uint8_t c = str[i];
|
uint8_t c = str[i];
|
||||||
if(c <= '9')
|
if(c <= '9')
|
||||||
c -= '9';
|
c -= '0';
|
||||||
else
|
else
|
||||||
c -= 'A';
|
c -= 'A' - 10;
|
||||||
id = id << 4;
|
id = id << 4;
|
||||||
id |= c;
|
id |= c;
|
||||||
}
|
}
|
||||||
@ -157,9 +157,9 @@ std::string ChatId::toStdString() const
|
|||||||
{
|
{
|
||||||
uint8_t c = id >>(64-4);
|
uint8_t c = id >>(64-4);
|
||||||
if(c > 9)
|
if(c > 9)
|
||||||
c += 'A';
|
c += 'A' - 10;
|
||||||
else
|
else
|
||||||
c += '1';
|
c += '0';
|
||||||
str += c;
|
str += c;
|
||||||
id = id << 4;
|
id = id << 4;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user