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:
csoler 2015-02-13 19:09:03 +00:00
parent 085c6b1932
commit 0d308ffa2e

View File

@ -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;
} }