mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
added a ending 0 to form a proper string in gpg cert export
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2306 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
6daa5809c7
commit
7a10cd6c95
@ -1137,7 +1137,14 @@ std::string AuthGPG::SaveCertificateToString(std::string id)
|
|||||||
|
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len);
|
char *export_txt = gpgme_data_release_and_get_mem(gpgmeData, &len);
|
||||||
tmp = std::string(export_txt,len);
|
|
||||||
|
char *str = new char[len+1] ;
|
||||||
|
memcpy(str,export_txt,len) ;
|
||||||
|
str[len]=0 ;
|
||||||
|
|
||||||
|
tmp = std::string(str);
|
||||||
|
|
||||||
|
delete[] str ;
|
||||||
|
|
||||||
#ifdef GPG_DEBUG
|
#ifdef GPG_DEBUG
|
||||||
std::cerr << "Exported Certificate: " << std::endl << tmp << std::endl;
|
std::cerr << "Exported Certificate: " << std::endl << tmp << std::endl;
|
||||||
|
Loading…
Reference in New Issue
Block a user