Refactor load_certs()

This commit is contained in:
louiz’
2016-11-01 19:43:56 +01:00
parent e1934a0b5f
commit f50f50653d
3 changed files with 29 additions and 23 deletions
+2 -2
View File
@@ -151,7 +151,7 @@ namespace utils
throw std::runtime_error("Cannot convert into UTF-8");
// Make sure cd is always closed when we leave this function
const auto sg = utils::make_scope_guard([&](auto&&){ iconv_close(cd); });
const auto sg = utils::make_scope_guard([&cd](auto&&){ iconv_close(cd); });
size_t inbytesleft = str.size();
@@ -168,7 +168,7 @@ namespace utils
char* outbuf_ptr = outbuf;
// Make sure outbuf is always deleted when we leave this function
const auto sg2 = utils::make_scope_guard([&](auto&&){ delete[] outbuf; });
const auto sg2 = utils::make_scope_guard([outbuf](auto&&){ delete[] outbuf; });
bool done = false;
while (done == false)