From 49631972db5b965413d4bbe36983a8d5bd203183 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sun, 2 Apr 2017 06:23:19 +0300 Subject: Use pathJoin for concatinate some paths. --- src/chatlogger.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/chatlogger.cpp') 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); } -- cgit v1.2.3-70-g09d2