summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/mir_core/src/path.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mir_core/src/path.cpp b/src/mir_core/src/path.cpp
index eb1577748e..dd5e49325f 100644
--- a/src/mir_core/src/path.cpp
+++ b/src/mir_core/src/path.cpp
@@ -39,8 +39,10 @@ MIR_CORE_DLL(int) PathIsAbsolute(const char *path)
MIR_CORE_DLL(int) PathToRelative(const char *pSrc, char *pOut, const char *pBase)
{
- if (!pSrc || !pSrc[0] || strlen(pSrc) > MAX_PATH)
+ if (!pSrc || !pSrc[0] || strlen(pSrc) > MAX_PATH) {
+ *pOut = 0;
return 0;
+ }
if (!PathIsAbsolute(pSrc))
strncpy_s(pOut, MAX_PATH, pSrc, _TRUNCATE);