mirror of
https://github.com/PurpleI2P/i2pd-tools.git
synced 2025-09-04 04:10:23 +01:00
fix: i2pbase64.cpp fix
This commit is contained in:
parent
570bad5af4
commit
a73b83bd2a
1 changed files with 3 additions and 1 deletions
|
@ -21,8 +21,10 @@ int operate_b64_decode(int infile, int outfile) {
|
||||||
ssize_t sz;
|
ssize_t sz;
|
||||||
while ((sz = read(infile, inbuf, sizeof(inbuf))) > 0) {
|
while ((sz = read(infile, inbuf, sizeof(inbuf))) > 0) {
|
||||||
std::string_view chunk(inbuf, sz);
|
std::string_view chunk(inbuf, sz);
|
||||||
|
std::string s(chunk);
|
||||||
|
s.erase(std::remove(s.begin(), s.end(), '\n'), s.end());
|
||||||
|
|
||||||
size_t outsz = i2p::data::Base64ToByteStream(chunk, outbuf, sizeof(outbuf));
|
size_t outsz = i2p::data::Base64ToByteStream(s, outbuf, sizeof(outbuf));
|
||||||
if (outsz > 0) {
|
if (outsz > 0) {
|
||||||
write(outfile, outbuf, outsz);
|
write(outfile, outbuf, outsz);
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue