From f7e76bcda435d7ca6f6c8f9d78ceba5ad2066d16 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 20 Jul 2023 15:51:18 +0300 Subject: =?UTF-8?q?fixes=20#3591=20completely=20(=D0=9E=D1=82=D0=BD=D0=BE?= =?UTF-8?q?=D1=81=D0=B8=D1=82=D0=B5=D0=BB=D1=8C=D0=BD=D1=8B=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=83=D1=82=D0=B8=20=D0=B2=20=D1=81=D0=BA=D0=B8=D0=BD=D0=B0?= =?UTF-8?q?=D1=85)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mir_core/src/Windows/path.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mir_core/src/Windows/path.cpp b/src/mir_core/src/Windows/path.cpp index eb14c6b0de..907de96b74 100644 --- a/src/mir_core/src/Windows/path.cpp +++ b/src/mir_core/src/Windows/path.cpp @@ -130,8 +130,10 @@ MIR_CORE_DLL(int) PathIsAbsoluteW(const wchar_t *path) MIR_CORE_DLL(int) PathToRelativeW(const wchar_t *pSrc, wchar_t *pOut, const wchar_t *pBase) { - if (!pSrc || !pSrc[0] || wcslen(pSrc) > MAX_PATH) + if (!pSrc || !pSrc[0] || wcslen(pSrc) > MAX_PATH) { + *pOut = 0; return 0; + } if (!PathIsAbsoluteW(pSrc)) wcsncpy_s(pOut, MAX_PATH, pSrc, _TRUNCATE); -- cgit v1.2.3