fix(file_handler): avoid writing extra newline character (#2335)

This commit is contained in:
ReenigneArcher
2024-05-12 13:13:20 -04:00
committed by GitHub
parent 6674090052
commit 659a426b03
2 changed files with 46 additions and 15 deletions

View File

@@ -31,16 +31,7 @@ namespace file_handler {
}
std::ifstream in(path);
std::string input;
std::string base64_cert;
while (!in.eof()) {
std::getline(in, input);
base64_cert += input + '\n';
}
return base64_cert;
return std::string { (std::istreambuf_iterator<char>(in)), std::istreambuf_iterator<char>() };
}
/**