summaryrefslogtreecommitdiff
path: root/src/chatlogger.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/chatlogger.cpp')
-rw-r--r--src/chatlogger.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/chatlogger.cpp b/src/chatlogger.cpp
index ff803ef2b..1b0b7052d 100644
--- a/src/chatlogger.cpp
+++ b/src/chatlogger.cpp
@@ -185,11 +185,10 @@ void ChatLogger::setServerName(const std::string &serverName)
secureName(mServerName);
if (!mLogDir.empty())
{
- const char *const name = (std::string(mLogDir).append(dirSeparator)
- .append(mServerName)).c_str();
- DIR *const dir = opendir(name);
+ const std::string name = pathJoin(mLogDir, mServerName);
+ DIR *const dir = opendir(name.c_str());
if (!dir)
- mkdir_r(name);
+ mkdir_r(name.c_str());
else
closedir(dir);
}