Skip to content
This repository has been archived by the owner on Sep 1, 2022. It is now read-only.

Commit

Permalink
Filesystem: use string instead of c_str for path
Browse files Browse the repository at this point in the history
- For Boost.Filesystem, fixes win build
- Also remove redundant std::ofstream::out

References #493 #354
  • Loading branch information
anonimal committed Dec 10, 2016
1 parent f5a915f commit 48368b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/core/router/context.cc
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ void RouterContext::UpdateStats() {

bool RouterContext::Load() {
auto path = kovri::core::EnsurePath(kovri::core::GetCorePath());
std::ifstream fk((path / ROUTER_KEYS).c_str(), std::ifstream::binary);
std::ifstream fk((path / ROUTER_KEYS).string(), std::ifstream::binary);
// If key does not exist, create
if (!fk.is_open())
return false;
Expand All @@ -335,8 +335,8 @@ bool RouterContext::Load() {

void RouterContext::SaveKeys() {
std::ofstream fk(
(kovri::core::GetCorePath() / ROUTER_KEYS).c_str(),
std::ofstream::binary | std::ofstream::out);
(kovri::core::GetCorePath() / ROUTER_KEYS).string(),
std::ofstream::binary);
const std::size_t len = m_Keys.GetFullLen();
std::unique_ptr<std::uint8_t[]> buf(std::make_unique<std::uint8_t[]>(len));
m_Keys.ToBuffer(buf.get(), len);
Expand Down

0 comments on commit 48368b9

Please sign in to comment.