diff --git a/daemon/extension/Extension.cpp b/daemon/extension/Extension.cpp index 62555d32..26531e5a 100644 --- a/daemon/extension/Extension.cpp +++ b/daemon/extension/Extension.cpp @@ -402,7 +402,8 @@ namespace Extension } else if (const double* val = std::get_if(&option.value)) { - Xml::AddNewNode(optionsNode, "Value", "double", std::to_string(*val).c_str()); + std::string valStr = std::to_string(*val); + Xml::AddNewNode(optionsNode, "Value", "double", valStr.c_str()); } xmlNodePtr selectNode = xmlNewNode(nullptr, BAD_CAST "Select"); @@ -414,7 +415,8 @@ namespace Extension } else if (const double* val = std::get_if(&selectOption)) { - Xml::AddNewNode(selectNode, "Value", "double", std::to_string(*val).c_str()); + std::string valStr = std::to_string(*val); + Xml::AddNewNode(selectNode, "Value", "double", valStr.c_str()); } } diff --git a/daemon/util/FileSystem.cpp b/daemon/util/FileSystem.cpp index 2b3d6b07..706d2e88 100644 --- a/daemon/util/FileSystem.cpp +++ b/daemon/util/FileSystem.cpp @@ -56,17 +56,17 @@ void FileSystem::NormalizePathSeparators(char* path) } } -std::optional FileSystem::GetFileRealPath(std::string_view path) +std::optional FileSystem::GetFileRealPath(const std::string& path) { #ifdef WIN32 char buffer[MAX_PATH]; - DWORD len = GetFullPathName(path.data(), MAX_PATH, buffer, nullptr); + DWORD len = GetFullPathName(path.c_str(), MAX_PATH, buffer, nullptr); if (len != 0) { return std::optional{ buffer }; } #else - if (char* realPath = realpath(path.data(), nullptr)) + if (char* realPath = realpath(path.c_str(), nullptr)) { std::string res = realPath; free(realPath); diff --git a/daemon/util/FileSystem.h b/daemon/util/FileSystem.h index 2d9cc200..1aabb697 100644 --- a/daemon/util/FileSystem.h +++ b/daemon/util/FileSystem.h @@ -40,7 +40,7 @@ class FileSystem static char* BaseFileName(const char* filename); static bool SameFilename(const char* filename1, const char* filename2); static void NormalizePathSeparators(char* path); - static std::optional GetFileRealPath(std::string_view path); + static std::optional GetFileRealPath(const std::string& path); static bool LoadFileIntoBuffer(const char* filename, CharBuffer& buffer, bool addTrailingNull); static bool SaveBufferIntoFile(const char* filename, const char* buffer, int bufLen); static bool AllocateFile(const char* filename, int64 size, bool sparse, CString& errmsg);