aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authors_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-07-25 21:49:21 +0000
committers_nakamoto <s_nakamoto@1a98c847-1fd6-4fd8-948a-caf3550aa51b>2010-07-25 21:49:21 +0000
commit6966768a554575ca329fbcd4aad0d4f21c702f9a (patch)
tree30ff6446ae5d5779de5c24bacc1bdc526085b384
parent7d46f9250cef06d248617085a7439e8ef8841cd7 (diff)
Gavin: BIO_FLAGS_BASE64_NO_NL
git-svn-id: https://bitcoin.svn.sourceforge.net/svnroot/bitcoin/trunk@111 1a98c847-1fd6-4fd8-948a-caf3550aa51b
-rw-r--r--rpc.cpp7
1 files changed, 2 insertions, 5 deletions
diff --git a/rpc.cpp b/rpc.cpp
index bf522d0fa3..ee5e84638d 100644
--- a/rpc.cpp
+++ b/rpc.cpp
@@ -765,19 +765,16 @@ string EncodeBase64(string s)
BUF_MEM *bptr;
b64 = BIO_new(BIO_f_base64());
+ BIO_set_flags(b64, BIO_FLAGS_BASE64_NO_NL);
bmem = BIO_new(BIO_s_mem());
b64 = BIO_push(b64, bmem);
BIO_write(b64, s.c_str(), s.size());
BIO_flush(b64);
BIO_get_mem_ptr(b64, &bptr);
- string result(bptr->data, bptr->length-1);
+ string result(bptr->data, bptr->length);
BIO_free_all(b64);
- // Remove newlines every 64 characters
- result.erase(std::remove(result.begin(), result.end(), '\n'), result.end());
- result.erase(std::remove(result.begin(), result.end(), '\r'), result.end());
-
return result;
}