diff --git a/src/common/util/include/openvino/util/file_util.hpp b/src/common/util/include/openvino/util/file_util.hpp index 6c7853cd4ae..05538638c9d 100644 --- a/src/common/util/include/openvino/util/file_util.hpp +++ b/src/common/util/include/openvino/util/file_util.hpp @@ -95,7 +95,7 @@ std::wstring string_to_wstring(const std::string& str); /// \brief Remove path components which would allow traversing up a directory tree. /// \param path A path to file -/// \return A sanitiazed path +/// \return A sanitized path std::string sanitize_path(const std::string& path); /// \brief Returns the name with extension for a given path diff --git a/src/common/util/src/os/win/win_shared_object_loader.cpp b/src/common/util/src/os/win/win_shared_object_loader.cpp index e40f59cd1f2..82a41a129d1 100644 --- a/src/common/util/src/os/win/win_shared_object_loader.cpp +++ b/src/common/util/src/os/win/win_shared_object_loader.cpp @@ -92,15 +92,7 @@ std::shared_ptr load_shared_object(const char* path) { IEGetDllDirectoryA(nBufferLength, &lpBuffer.front()); // GetDirname - auto dirname = [path] { - auto pos = strchr(path, '\\'); - if (pos == nullptr) { - return std::string{path}; - } - std::string original(path); - original[pos - path] = 0; - return original; - }(); + auto dirname = get_directory(path); SetDllDirectoryA(dirname.c_str()); shared_object = LoadLibraryA(path);